126 references to ERR_RefConstraintNotSatisfied
Microsoft.CodeAnalysis.CSharp (2)
Errors\ErrorFacts.cs (1)
902
or ErrorCode.
ERR_RefConstraintNotSatisfied
Symbols\ConstraintsHelper.cs (1)
1003
diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.
ERR_RefConstraintNotSatisfied
, containingSymbol.ConstructedFrom(), typeParameter, typeArgument.Type))));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (22)
CodeGen\CodeGenTupleEqualityTests.cs (6)
2552
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "0").WithArguments("(T1, T2)", "T1", "int").WithLocation(6, 30),
2555
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "0").WithArguments("(T1, T2)", "T1", "int").WithLocation(6, 30),
2558
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "1").WithArguments("(T1, T2)", "T2", "int").WithLocation(6, 33),
2561
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "1").WithArguments("(T1, T2)", "T2", "int").WithLocation(6, 33),
2564
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "this").WithArguments("(T1, T2)", "T1", "int").WithLocation(7, 30),
2567
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "this").WithArguments("(T1, T2)", "T2", "int").WithLocation(7, 36)
CodeGen\CodeGenTupleTest.cs (16)
10366
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "p").WithArguments("(T1, T2)", "T2", "int").WithLocation(14, 33),
10369
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "2").WithArguments("(T1, T2)", "T2", "int").WithLocation(16, 22),
10372
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("(T1, T2)", "T2", "int").WithLocation(17, 15)
10447
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M").WithArguments("(T1, T2)", "T2", "U").WithLocation(15, 12),
10450
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "field").WithArguments("(T1, T2)", "T2", "T").WithLocation(14, 18),
10453
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "U").WithArguments("(T1, T2)", "T2", "U").WithLocation(19, 28),
10488
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("C<T>", "T", "int").WithLocation(17, 24),
10491
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M").WithArguments("C<T>.M<U>(U)", "U", "int").WithLocation(18, 18),
10532
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("C<T>", "T", "int").WithLocation(17, 24),
10535
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M").WithArguments("C<T>.M<U>(U)", "U", "(int, int)").WithLocation(18, 18),
10599
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "p").WithArguments("System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>", "TRest", "System.ValueTuple<int>").WithLocation(42, 53),
10602
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "p").WithArguments("System.ValueTuple<T1>", "T1", "int").WithLocation(42, 53),
10605
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "(1, 2, 3, 4, 5, 6, 7, 8)").WithArguments("System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>", "TRest", "System.ValueTuple<int>").WithLocation(44, 18),
10608
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "8").WithArguments("System.ValueTuple<T1>", "T1", "int").WithLocation(44, 40),
10611
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "(int, int, int, int, int, int, int, int)").WithArguments("System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>", "TRest", "System.ValueTuple<int>").WithLocation(45, 9),
10614
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("System.ValueTuple<T1>", "T1", "int").WithLocation(45, 45)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\UnmanagedTypeModifierTests.cs (1)
1212
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M<int>").WithArguments("TestRef.M<T>()", "T", "int").WithLocation(6, 23),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (14)
Semantics\CollectionExpressionTests.cs (2)
19236
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("MyCollection<T>", "T", "int").WithLocation(7, 22),
19239
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "Create").WithArguments("MyCollection<T>", "T", "T").WithLocation(15, 35));
Semantics\ExtensionTests.cs (10)
33207
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M<int>").WithArguments("E.extension(object).M<U>()", "U", "int").WithLocation(1, 8),
33210
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M2<int>").WithArguments("E.M2<U>(object)", "U", "int").WithLocation(2, 14));
33243
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M").WithArguments("E.extension(object).M<U>(U)", "U", "int").WithLocation(1, 8),
33246
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M2").WithArguments("E.M2<U>(object, U)", "U", "int").WithLocation(2, 14));
33279
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M<int>").WithArguments("E.extension<T>(T)", "T", "int").WithLocation(1, 5),
33282
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M2<int>").WithArguments("E.M2<T>(T)", "T", "int").WithLocation(2, 4));
33315
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M").WithArguments("E.extension<T>(T)", "T", "int").WithLocation(1, 5),
33318
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M2").WithArguments("E.M2<T>(T)", "T", "int").WithLocation(2, 4));
33697
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M<int>").WithArguments("C<int>.M<T2>(T2)", "T2", "int").WithLocation(10, 16));
33727
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M").WithArguments("C<int>.M<T2>(T2)", "T2", "int").WithLocation(10, 16));
Semantics\RecordTests.cs (2)
25748
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("R<T>", "T", "int").WithLocation(9, 19),
25751
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("R2<T>", "T", "int").WithLocation(10, 20)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (31)
Semantics\BindingTests.cs (2)
3668
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "A<A<int>[]>.B").WithArguments("A<T>", "T", "int").WithLocation(2, 14));
3684
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "A<int, string>").WithArguments("A<T, U>", "T", "int").WithLocation(2, 14),
Semantics\DynamicTests.cs (2)
1470
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "c.Goo<short>(d, d)").WithArguments("C.Goo<T>(int, int)", "T", "short").WithLocation(15, 19)
1481
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "Goo<short>").WithArguments("C.Goo<T>(int, int)", "T", "short").WithLocation(15, 21)
Semantics\GenericConstraintsTests.cs (8)
75
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "E1").WithArguments("Test<T>", "T", "E1").WithLocation(13, 26),
78
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("Test<T>", "T", "int").WithLocation(14, 26),
253
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "E1").WithArguments("Test<T>", "T", "E1").WithLocation(11, 26),
256
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("Test<T>", "T", "int").WithLocation(12, 26),
760
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("Test<T>", "T", "int").WithLocation(11, 26),
861
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("Test<T>", "T", "int").WithLocation(8, 26),
1241
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("Test<T>", "T", "int").WithLocation(11, 26),
1342
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("Test<T>", "T", "int").WithLocation(8, 26),
Semantics\GlobalUsingDirectiveTests.cs (8)
4913
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "A1").WithArguments("C<T>", "T", "int").WithLocation(1000, 14),
4916
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C<byte>").WithArguments("C<T>", "T", "byte").WithLocation(2000, 21),
4919
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "A2").WithArguments("C<T>", "T", "long").WithLocation(3000, 7),
4922
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C<short>").WithArguments("C<T>", "T", "short").WithLocation(3001, 14)
4938
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "A1").WithArguments("C<T>", "T", "int").WithLocation(1000, 14),
4941
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C<byte>").WithArguments("C<T>", "T", "byte").WithLocation(2000, 21),
4954
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "A2").WithArguments("C<T>", "T", "long").WithLocation(3000, 7),
4957
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C<short>").WithArguments("C<T>", "T", "short").WithLocation(3001, 14)
Semantics\InterceptorsTests.cs (1)
6690
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "InterceptsLocation").WithArguments("D.Generic<T, U>(C<T>, U)", "T", "int").WithLocation(6, 6));
Semantics\NullableReferenceTypesTests.cs (6)
157406
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "FTC<TQ?>").WithArguments("C.FTC<TC>(TC)", "TC", "TQ").WithLocation(13, 11),
157412
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "FTCO<TQ?>").WithArguments("C.FTCO<TCO>(TCO)", "TCO", "TQ").WithLocation(18, 20),
157424
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "FTC<T>").WithArguments("C.FTC<TC>(TC)", "TC", "T").WithLocation(33, 11),
157433
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "FTCO<T>").WithArguments("C.FTCO<TCO>(TCO)", "TCO", "T").WithLocation(38, 11),
157451
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "FTC<TO>").WithArguments("C.FTC<TC>(TC)", "TC", "TO").WithLocation(76, 11),
157454
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "FTCO<TO>").WithArguments("C.FTCO<TCO>(TCO)", "TCO", "TO").WithLocation(86, 11),
Semantics\RecordStructTests.cs (3)
440
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "c").WithArguments("C3<T>", "T", "Point").WithLocation(16, 22)
3032
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("R<T>", "T", "int").WithLocation(9, 19),
3035
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("R2<T>", "T", "int").WithLocation(10, 20)
Semantics\SemanticErrorTests.cs (1)
10899
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "GenericMethod<int>").WithArguments("Code.GenericMethod<T>(int)", "T", "int").WithLocation(9, 9));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (56)
Symbols\GenericConstraintTests.cs (37)
479
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C").WithArguments("I<T, U>", "T", "int").WithLocation(8, 7),
483
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "I<int, object>").WithArguments("I<T, U>", "T", "int").WithLocation(10, 10),
487
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "I<int, object>").WithArguments("I<T, U>", "T", "int").WithLocation(11, 12),
607
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C1").WithArguments("A<T>", "T", "T").WithLocation(13, 16),
609
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C1").WithArguments("I<T>", "T", "T").WithLocation(13, 16),
611
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F").WithArguments("A<T>", "T", "U").WithLocation(15, 28),
613
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "a").WithArguments("I<T>", "T", "U").WithLocation(15, 38),
615
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C2").WithArguments("A<T>", "T", "T").WithLocation(18, 16),
617
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C2").WithArguments("A<T>", "T", "T").WithLocation(18, 16),
619
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F").WithArguments("A<T>", "T", "U").WithLocation(20, 30),
621
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "a").WithArguments("A<T>", "T", "U").WithLocation(20, 42),
633
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C4").WithArguments("A<T>", "T", "T").WithLocation(28, 16),
635
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F").WithArguments("A<T>", "T", "U").WithLocation(30, 33),
639
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C5").WithArguments("I<T>", "T", "T").WithLocation(33, 16),
641
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C5").WithArguments("A<T>", "T", "T").WithLocation(33, 16),
643
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F").WithArguments("A<T>", "T", "U").WithLocation(35, 31),
645
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "a").WithArguments("I<T>", "T", "U").WithLocation(35, 44),
649
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "b").WithArguments("A<T>", "T", "Y").WithLocation(40, 54));
787
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "A").WithArguments("C<T>", "T", "int").WithLocation(1, 7),
789
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "B").WithArguments("C<T>", "T", "bool").WithLocation(2, 7),
819
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "B2").WithArguments("C<T>", "T", "int"),
861
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "float").WithArguments("B<T>", "T", "float").WithLocation(11, 18),
865
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F").WithArguments("B<T>", "T", "byte").WithLocation(10, 20),
867
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "o").WithArguments("B<T>", "T", "double").WithLocation(12, 19),
869
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("B<T>", "T", "int").WithLocation(8, 14),
873
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "short").WithArguments("B<T>", "T", "short").WithLocation(9, 22),
960
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "E").WithArguments("I<T>", "T", "short").WithLocation(8, 23),
963
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "i").WithArguments("I<T>", "T", "int").WithLocation(5, 14),
966
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "P").WithArguments("I<T>", "T", "byte").WithLocation(6, 13),
969
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "index").WithArguments("I<T>", "T", "float").WithLocation(7, 29),
972
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "this").WithArguments("I<T>", "T", "double").WithLocation(7, 15),
993
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "long").WithArguments("I<T>", "T", "long").WithLocation(6, 21),
997
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "short").WithArguments("I<T>", "T", "short").WithLocation(7, 13),
4452
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("A<T>", "T", "int").WithLocation(9, 10),
4456
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "U").WithArguments("A<T>", "T", "int").WithLocation(11, 13),
4458
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("A<T>", "T", "int").WithLocation(14, 13),
4462
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "U").WithArguments("A<T>", "T", "int").WithLocation(16, 16));
Symbols\StaticAbstractMembersInInterfacesTests.cs (4)
22855
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C2").WithArguments("I1<T>", "T", "C2").WithLocation(12, 8),
22858
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "I1<C2>").WithArguments("I1<T>", "T", "C2").WithLocation(14, 19),
22861
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, op).WithArguments("I1<T>", "T", "C2").WithLocation(14, 35),
22864
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "x").WithArguments("I1<T>", "T", "C2").WithLocation(14, 44 + op.Length - 1)
Symbols\SymbolErrorTests.cs (12)
7580
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(9, 15),
7582
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(10, 9),
7584
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(19, 15),
7586
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(20, 9),
7588
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(24, 15),
7590
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(25, 9),
7592
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(29, 15),
7594
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(30, 9),
7596
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(39, 15),
7598
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(40, 9),
7600
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int?").WithArguments("B<T>", "T", "int?").WithLocation(44, 15),
7602
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F<int?>").WithArguments("C.F<U>()", "U", "int?").WithLocation(45, 9));
Symbols\UserDefinedOperatorErrorTests.cs (3)
308
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "+").WithArguments("C.D<T>", "T", "int"),
312
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "d").WithArguments("C.D<T>", "T", "double"),
316
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "d").WithArguments("C.D<T>", "T", "decimal")