219 references to ERR_ValConstraintNotSatisfied
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Expressions.cs (3)
2363
Error(diagnostics, ErrorCode.
ERR_ValConstraintNotSatisfied
, node, nullableType, nullableType.TypeParameters.Single(), indexType);
2443
Error(diagnostics, ErrorCode.
ERR_ValConstraintNotSatisfied
, node, nullableType, nullableType.TypeParameters.Single(), rangeType);
2470
Error(diagnostics, ErrorCode.
ERR_ValConstraintNotSatisfied
, operand, nullableType, nullableType.TypeParameters.Single(), indexType);
Errors\ErrorFacts.cs (1)
841
case ErrorCode.
ERR_ValConstraintNotSatisfied
:
Symbols\ConstraintsHelper.cs (1)
940
diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.
ERR_ValConstraintNotSatisfied
, containingSymbol.ConstructedFrom(), typeParameter, typeArgument.Type))));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (3)
CodeGen\CodeGenTupleTest.cs (3)
10532
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M").WithArguments("(T1, T2)", "T2", "U").WithLocation(15, 12),
10535
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "field").WithArguments("(T1, T2)", "T2", "T").WithLocation(14, 18),
10544
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "U").WithArguments("(T1, T2)", "T2", "U").WithLocation(19, 28),
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Attributes\AttributeTests.cs (1)
10262
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "object").WithArguments("C<T>", "T", "object").WithLocation(4, 4));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (154)
Semantics\BindingTests.cs (2)
3388
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test<System.String>").WithArguments("Test<T>", "T", "string").WithLocation(2, 14));
3427
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "A<int, string>").WithArguments("A<T, U>", "U", "string").WithLocation(2, 14));
Semantics\DynamicTests.cs (3)
1799
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<string>").WithArguments("C.F<T>(T, X<T>)", "T", "string"));
1825
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<string>").WithArguments("C.F<T>(T, X<T>)", "T", "string").WithLocation(13, 9));
1894
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "StructConstraint<dynamic>").WithArguments("C.StructConstraint<T>()", "T", "dynamic"));
Semantics\FunctionPointerTests.cs (1)
3650
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "ptr").WithArguments("E<T>", "T", "T").WithLocation(9, 32)
Semantics\GenericConstraintsTests.cs (4)
145
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "string").WithArguments("Test<T>", "T", "string").WithLocation(15, 26),
148
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "System.Enum").WithArguments("Test<T>", "T", "System.Enum").WithLocation(16, 26));
295
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "string").WithArguments("Test<T>", "T", "string").WithLocation(13, 26),
298
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "System.Enum").WithArguments("Test<T>", "T", "System.Enum").WithLocation(14, 26));
Semantics\IndexAndRangeTests.cs (4)
838
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "^arg").WithArguments("System.Nullable<T>", "T", "System.Index").WithLocation(13, 17));
1050
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "index..index").WithArguments("System.Nullable<T>", "T", "System.Range").WithLocation(13, 17));
1078
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "index").WithArguments("System.Nullable<T>", "T", "System.Index").WithLocation(18, 17),
1084
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "index").WithArguments("System.Nullable<T>", "T", "System.Index").WithLocation(18, 24),
Semantics\NullableReferenceTypesTests.cs (120)
11484
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(16, 35),
11490
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M2").WithArguments("System.Nullable<T>", "T", "T").WithLocation(20, 24));
11684
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(43, 38));
11751
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 35)
11823
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(27, 35),
11826
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(31, 35),
11829
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(35, 35),
11832
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(23, 35)
11873
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(4, 50),
11876
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 35)
11911
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M1").WithArguments("System.Nullable<T>", "T", "T").WithLocation(4, 42),
11914
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M1").WithArguments("System.Nullable<T>", "T", "T").WithLocation(12, 27)
11996
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M4").WithArguments("System.Nullable<T>", "T", "string").WithLocation(19, 44),
11999
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M5").WithArguments("System.Nullable<T>", "T", "string").WithLocation(24, 36)
12070
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "string").WithLocation(16, 52),
12073
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "string").WithLocation(20, 44),
13186
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M2").WithArguments("System.Nullable<T>", "T", "S").WithLocation(23, 26),
13189
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M3").WithArguments("System.Nullable<T>", "T", "S").WithLocation(28, 27));
13250
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M2").WithArguments("System.Nullable<T>", "T", "S").WithLocation(24, 26),
13384
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M2").WithArguments("System.Nullable<T>", "T", "S").WithLocation(23, 13),
13387
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M3").WithArguments("System.Nullable<T>", "T", "S").WithLocation(28, 14),
13456
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M2").WithArguments("System.Nullable<T>", "T", "S").WithLocation(17, 13),
13667
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(22, 37),
13670
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(26, 38)
13729
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(18, 37)
16535
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(20, 24),
16538
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(24, 25));
63544
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "System.Nullable<int>?").WithArguments("System.Nullable<T>", "T", "int?").WithLocation(31, 18),
75177
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(7, 20));
94561
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t1").WithArguments("System.Nullable<T>", "T", "T11").WithLocation(15, 39));
94603
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t1").WithArguments("System.Nullable<T>", "T", "T11").WithLocation(4, 39));
94646
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t1").WithArguments("System.Nullable<T>", "T", "T11").WithLocation(4, 39));
94755
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t1").WithArguments("System.Nullable<T>", "T", "T11").WithLocation(15, 39));
106646
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(14, 37),
106652
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(15, 37),
106658
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(17, 37),
106664
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 37),
106670
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 37));
127068
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "U?").WithArguments("System.Nullable<T>", "T", "U").WithLocation(17, 19)
134722
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "value").WithArguments("System.Nullable<T>", "T", "T").WithLocation(15, 22));
134755
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "value").WithArguments("System.Nullable<T>", "T", "T").WithLocation(15, 22));
135110
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "value").WithArguments("System.Nullable<T>", "T", "T").WithLocation(12, 24));
145803
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(10, 37),
145891
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F1").WithArguments("System.Nullable<T>", "T", "T").WithLocation(4, 24),
145897
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F2").WithArguments("System.Nullable<T>", "T", "T").WithLocation(5, 24),
145903
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F3").WithArguments("System.Nullable<T>", "T", "T").WithLocation(6, 24),
145909
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F5").WithArguments("System.Nullable<T>", "T", "T").WithLocation(8, 24),
145915
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F7").WithArguments("System.Nullable<T>", "T", "T").WithLocation(10, 24),
145921
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F8").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 24));
146017
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F1").WithArguments("System.Nullable<T>", "T", "T").WithLocation(4, 24),
146026
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F2").WithArguments("System.Nullable<T>", "T", "T").WithLocation(5, 24),
146035
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F3").WithArguments("System.Nullable<T>", "T", "T").WithLocation(6, 24),
146044
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F5").WithArguments("System.Nullable<T>", "T", "T").WithLocation(8, 24),
146053
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F7").WithArguments("System.Nullable<T>", "T", "T").WithLocation(10, 24),
146062
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F8").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 24),
146292
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
146298
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
146313
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
146319
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
146340
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
146346
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
146361
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
146367
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
146420
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
146426
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
146441
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
146447
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
146500
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
146506
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
146521
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
146527
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
146577
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
146583
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
146595
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
146601
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
146663
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
146669
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
146684
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
146690
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
146743
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
146749
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
146764
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
146770
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
146832
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
146838
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
146850
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
146856
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
146934
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 24),
146940
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 24),
146970
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 25),
146979
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 25),
147036
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 24),
147042
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 24),
147057
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 25),
147063
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 25),
147116
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 29),
147122
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 29),
147137
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 30),
147143
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 30),
147205
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 26),
147211
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 26),
147223
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 27),
147229
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 27),
148926
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F1").WithArguments("System.Nullable<T>", "T", "T").WithLocation(4, 24),
148932
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F2").WithArguments("System.Nullable<T>", "T", "T").WithLocation(5, 24),
148938
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F3").WithArguments("System.Nullable<T>", "T", "T").WithLocation(6, 24),
148944
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F4").WithArguments("System.Nullable<T>", "T", "T").WithLocation(7, 24),
148950
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F5").WithArguments("System.Nullable<T>", "T", "T").WithLocation(8, 24),
148956
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F6").WithArguments("System.Nullable<T>", "T", "T").WithLocation(9, 24),
148980
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(13, 35),
148986
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(14, 35),
148992
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(15, 35),
148998
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(16, 35),
149004
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(17, 35),
149010
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(18, 35));
151921
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "").WithArguments("System.Nullable<T>", "T", "T?").WithLocation(11, 55),
151924
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 55)
151952
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T?").WithLocation(11, 52),
151955
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 52)
151986
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 47)
Semantics\NullableTests.cs (4)
41
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Nullable<int>").WithArguments("System.Nullable<T>", "T", "int?"),
68
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "string").WithArguments("System.Nullable<T>", "T", "string").WithLocation(8, 14)
79
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "string").WithArguments("System.Nullable<T>", "T", "string").WithLocation(8, 14));
103
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "string").WithArguments("System.Nullable<T>", "T", "string").WithLocation(8, 18)
Semantics\OverloadResolutionTests.cs (15)
1472
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "ny").WithArguments("C.N<T>", "T", "Y").WithLocation(67, 36),
1475
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test1<string>").WithArguments("C.Test1<U>(U, C.N<U>)", "U", "string").WithLocation(17, 9),
1478
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test2").WithArguments("C.Test2<V>(V, C.N<V>)", "V", "string").WithLocation(21, 9),
1481
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test4").WithArguments("C.Test4<X>(X)", "X", "string").WithLocation(36, 9),
1484
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test5").WithArguments("C.N<T>", "T", "string").WithLocation(47, 9),
1487
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "string").WithArguments("C.L<S>", "S", "string").WithLocation(58, 17),
1490
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test6<L<string>>").WithArguments("C.L<S>", "S", "string").WithLocation(58, 9));
1495
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "ny").WithArguments("C.N<T>", "T", "Y").WithLocation(67, 36),
1498
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test1<string>").WithArguments("C.Test1<U>(U, C.N<U>)", "U", "string").WithLocation(17, 9),
1501
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test2").WithArguments("C.Test2<V>(V, C.N<V>)", "V", "string").WithLocation(21, 9),
1504
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test5").WithArguments("C.N<T>", "T", "string").WithLocation(47, 9),
1507
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "string").WithArguments("C.L<S>", "S", "string").WithLocation(58, 17),
1510
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test6<L<string>>").WithArguments("C.L<S>", "S", "string").WithLocation(58, 9));
11468
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<object>").WithArguments("B.F<T>(T)", "T", "object").WithLocation(11, 35)
11496
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<object>").WithArguments("B.F<T>(T)", "T", "object").WithLocation(11, 9)
Semantics\RefFieldTests.cs (1)
19409
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "s").WithArguments("System.Nullable<T>", "T", "T").WithLocation(8, 27));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (56)
Symbols\GenericConstraintTests.cs (33)
347
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "o").WithArguments("A<T>", "T", "A<int>.B1[]").WithLocation(14, 31),
353
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "o").WithArguments("A<T>", "T", "string").WithLocation(9, 28),
359
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "o").WithArguments("A<T>", "T", "A<int>[]").WithLocation(11, 28),
362
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "o").WithArguments("A<T>", "T", "string").WithLocation(12, 30),
479
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C").WithArguments("I<T, U>", "U", "object").WithLocation(8, 7),
483
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "I<int, object>").WithArguments("I<T, U>", "U", "object").WithLocation(10, 10),
487
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "I<int, object>").WithArguments("I<T, U>", "U", "object").WithLocation(11, 12));
621
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C3").WithArguments("B.C<U>", "U", "T").WithLocation(23, 16),
623
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C3").WithArguments("B.I<U>", "U", "T").WithLocation(23, 16),
625
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F").WithArguments("B.C<U>", "U", "U").WithLocation(25, 30),
627
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "a").WithArguments("B.I<U>", "U", "U").WithLocation(25, 42),
629
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C4").WithArguments("B.C<U>", "U", "T").WithLocation(28, 16),
635
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "a").WithArguments("B.C<U>", "U", "U").WithLocation(30, 50),
645
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C6").WithArguments("B.I<U>", "U", "U").WithLocation(38, 16),
681
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "U").WithArguments("A<T>", "T", "V").WithLocation(10, 28),
683
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "U").WithArguments("A<T>", "T", "V").WithLocation(18, 28),
685
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "a").WithArguments("A<T>", "T", "U").WithLocation(8, 36),
687
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "b").WithArguments("A<T>", "T", "A<int>").WithLocation(8, 51),
689
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M5").WithArguments("A<T>", "T", "U").WithLocation(11, 34));
811
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "A").WithArguments("I<T>", "T", "int?"),
894
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "object").WithArguments("A<T>", "T", "object").WithLocation(4, 31),
896
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<string>").WithArguments("B.F<T>(int)", "T", "string").WithLocation(8, 31));
1101
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "i.F").WithArguments("C.F<T>(T)", "T", "I").WithLocation(9, 9));
3693
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "IC1").WithArguments("IA1_1<T>", "T", "I").WithLocation(1, 11),
3702
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "IC2").WithArguments("IA2_1<T>", "T", "T").WithLocation(2, 11),
3711
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "IC3_1").WithArguments("IA3_1<T>", "T", "object").WithLocation(3, 11),
3714
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C2").WithArguments("IA2_1<T>", "T", "I").WithLocation(4, 7),
3723
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C3").WithArguments("IA3_1<T>", "T", "object").WithLocation(5, 7));
4452
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B1.B2<T, U>", "U", "A<T>").WithLocation(10, 10),
4458
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B1.B2<T, U>", "U", "A<T>").WithLocation(15, 13),
5672
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Goo").WithArguments("System.Nullable<T>", "T", "T").WithLocation(12, 24),
6065
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C5").WithArguments("C<T>", "T", "C5").WithLocation(24, 19),
6067
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C6").WithArguments("C<T>", "T", "C6").WithLocation(25, 15));
Symbols\StaticAbstractMembersInInterfacesTests.cs (6)
22296
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C2").WithArguments("I1<T>", "T", "C2").WithLocation(12, 7),
22299
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "I1<C2>").WithArguments("I1<T>", "T", "C2").WithLocation(14, 19),
22302
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, op).WithArguments("I1<T>", "T", "C2").WithLocation(14, 35),
22305
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("I1<T>", "T", "C2").WithLocation(14, 44 + op.Length - 1)
29958
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C2").WithArguments("I1<T>", "T", "C2").WithLocation(12, 7),
29961
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "I1<C2>").WithArguments("I1<T>", "T", "C2").WithLocation(14, 21)
Symbols\SymbolErrorTests.cs (17)
7582
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(9, 15),
7584
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(10, 9),
7586
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(14, 15),
7588
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(15, 9),
7590
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(24, 15),
7592
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(25, 9),
7594
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(29, 15),
7596
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(30, 9),
7598
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(34, 15),
7600
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(35, 9),
7602
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(39, 15),
7604
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(40, 9),
7606
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "int?").WithArguments("B<T>", "T", "int?").WithLocation(44, 15),
7608
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<int?>").WithArguments("C.F<U>()", "U", "int?").WithLocation(45, 9));
7657
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<U>").WithArguments("A<int?, object>.F<U>()", "U", "U").WithLocation(10, 9),
7659
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<U>").WithArguments("A<object, int?>.F<U>()", "U", "U").WithLocation(17, 9),
7661
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<U>").WithArguments("A<object, T>.F<U>()", "U", "U").WithLocation(31, 9));