244 references to ERR_ValConstraintNotSatisfied
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Expressions.cs (3)
2635
Error(diagnostics, ErrorCode.
ERR_ValConstraintNotSatisfied
, node, nullableType, nullableType.TypeParameters.Single(), indexType);
2715
Error(diagnostics, ErrorCode.
ERR_ValConstraintNotSatisfied
, node, nullableType, nullableType.TypeParameters.Single(), rangeType);
2742
Error(diagnostics, ErrorCode.
ERR_ValConstraintNotSatisfied
, operand, nullableType, nullableType.TypeParameters.Single(), indexType);
Errors\ErrorFacts.cs (1)
905
or ErrorCode.
ERR_ValConstraintNotSatisfied
Symbols\ConstraintsHelper.cs (1)
1043
diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.
ERR_ValConstraintNotSatisfied
, containingSymbol.ConstructedFrom(), typeParameter, typeArgument.Type))));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
CodeGen\CodeGenAsyncTests.cs (1)
9572
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "new C()").WithArguments("System.Runtime.CompilerServices.AsyncHelpers.AwaitAwaiter<TAwaiter>(TAwaiter)", "TAwaiter", "CAwaiter").WithLocation(3, 7)
CodeGen\CodeGenTupleTest.cs (3)
10526
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M").WithArguments("(T1, T2)", "T2", "U").WithLocation(15, 12),
10529
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "field").WithArguments("(T1, T2)", "T2", "T").WithLocation(14, 18),
10538
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "U").WithArguments("(T1, T2)", "T2", "U").WithLocation(19, 28),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (21)
Attributes\AttributeTests.cs (1)
10562
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "object").WithArguments("C<T>", "T", "object").WithLocation(4, 4));
Semantics\CollectionExpressionTests.cs (3)
20974
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "[4, null]").WithArguments("MyCollectionBuilder.Create<T>(System.ReadOnlySpan<T>)", "T", "int?").WithLocation(6, 32));
21037
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "[4, null]").WithArguments("MyCollectionBuilder.Create<T>(System.ReadOnlySpan<T>)", "T", "int?").WithLocation(6, 32));
43863
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("Extensions.Add<T>(MyCollection<T>, params T[])", "T", "int?").WithLocation(9, 40)
Semantics\ExtensionTests.cs (16)
3376
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C<T>").WithArguments("C<T>", "T", "T").WithLocation(3, 18));
4268
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "receiver").WithArguments("System.Nullable<T>", "T", "string").WithLocation(3, 39),
4271
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "System.Nullable<string>").WithArguments("System.Nullable<T>", "T", "string").WithLocation(7, 15)
12461
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M").WithArguments("Extensions.extension<T>(T)", "T", "object").WithLocation(1, 8),
12464
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M2").WithArguments("Extensions.M2<T>(T)", "T", "object").WithLocation(3, 14));
12500
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "object.P").WithArguments("E.extension<T>(T)", "T", "object").WithLocation(1, 5));
12557
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C1<T>").WithArguments("C1<T>", "T", "T").WithLocation(6, 18));
13444
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M<int, string>").WithArguments("E.extension<int>(C<int>).M<U>()", "U", "string").WithLocation(1, 14));
13474
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Method").WithArguments("E.extension<T>(T)", "T", "object").WithLocation(1, 14),
13477
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Method2").WithArguments("E.Method2<T>(T)", "T", "object").WithLocation(2, 14)
35624
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M").WithArguments("E.extension(object).M<T>(T, C<T>)", "T", "string").WithLocation(1, 4));
35647
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M").WithArguments("E.extension(object).M<T>(C<T>, T)", "T", "string").WithLocation(1, 4));
37472
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M<object>").WithArguments("E.extension<T>(T)", "T", "object").WithLocation(1, 4));
37692
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M<object>").WithArguments("E.extension(int).M<T>(T)", "T", "object").WithLocation(1, 4),
37695
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M2<object>").WithArguments("E.extension<T>(T)", "T", "object").WithLocation(2, 4),
37698
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M3<object>").WithArguments("E.M3<T>(int, T)", "T", "object").WithLocation(3, 4));
Semantics\ExtensionTests2.cs (1)
36222
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "object.P").WithArguments("E.extension<T>(T)", "T", "object").WithLocation(1, 9),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (158)
Semantics\BindingTests.cs (2)
3648
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test<System.String>").WithArguments("Test<T>", "T", "string").WithLocation(2, 14));
3687
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "A<int, string>").WithArguments("A<T, U>", "U", "string").WithLocation(2, 14));
Semantics\DelegateTypeTests.cs (3)
1155
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<object>").WithArguments("B.F<T>(T)", "T", "object").WithLocation(5, 29)
3175
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "new C().F<object>").WithArguments("E.F<T>(C)", "T", "object").WithLocation(1, 9));
3204
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "new C().F<object>").WithArguments("C.F<T>()", "T", "object").WithLocation(1, 9));
Semantics\DynamicTests.cs (3)
2025
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<string>").WithArguments("C.F<T>(T, X<T>)", "T", "string"));
2051
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<string>").WithArguments("C.F<T>(T, X<T>)", "T", "string").WithLocation(13, 9));
2120
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "StructConstraint<dynamic>").WithArguments("C.StructConstraint<T>()", "T", "dynamic"));
Semantics\FunctionPointerTests.cs (1)
3671
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)
839
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "^arg").WithArguments("System.Nullable<T>", "T", "System.Index").WithLocation(13, 17));
1051
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "index..index").WithArguments("System.Nullable<T>", "T", "System.Range").WithLocation(13, 17));
1079
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "index").WithArguments("System.Nullable<T>", "T", "System.Index").WithLocation(18, 17),
1085
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "index").WithArguments("System.Nullable<T>", "T", "System.Index").WithLocation(18, 24),
Semantics\InterceptorsTests.cs (1)
2619
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "InterceptsLocation").WithArguments("D.Interceptor1<T>(T)", "T", "string").WithLocation(5, 6));
Semantics\NullableReferenceTypesTests.cs (120)
11500
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(16, 35),
11506
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M2").WithArguments("System.Nullable<T>", "T", "T").WithLocation(20, 24));
11700
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(43, 38));
11767
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 35)
11839
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(27, 35),
11842
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(31, 35),
11845
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(35, 35),
11848
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(23, 35)
11889
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(4, 50),
11892
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 35)
11927
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M1").WithArguments("System.Nullable<T>", "T", "T").WithLocation(4, 42),
11930
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M1").WithArguments("System.Nullable<T>", "T", "T").WithLocation(12, 27)
12012
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M4").WithArguments("System.Nullable<T>", "T", "string").WithLocation(19, 44),
12015
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M5").WithArguments("System.Nullable<T>", "T", "string").WithLocation(24, 36)
12086
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "string").WithLocation(16, 52),
12089
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "string").WithLocation(20, 44),
13202
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M2").WithArguments("System.Nullable<T>", "T", "S").WithLocation(23, 26),
13205
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M3").WithArguments("System.Nullable<T>", "T", "S").WithLocation(28, 27));
13266
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M2").WithArguments("System.Nullable<T>", "T", "S").WithLocation(24, 26),
13400
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M2").WithArguments("System.Nullable<T>", "T", "S").WithLocation(23, 13),
13403
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M3").WithArguments("System.Nullable<T>", "T", "S").WithLocation(28, 14),
13472
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M2").WithArguments("System.Nullable<T>", "T", "S").WithLocation(17, 13),
13683
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(22, 37),
13686
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(26, 38)
13745
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(18, 37)
16569
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(20, 24),
16572
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(24, 25));
67016
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "System.Nullable<int>?").WithArguments("System.Nullable<T>", "T", "int?").WithLocation(31, 18),
78934
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(7, 20));
98415
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t1").WithArguments("System.Nullable<T>", "T", "T11").WithLocation(15, 39));
98457
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t1").WithArguments("System.Nullable<T>", "T", "T11").WithLocation(4, 39));
98500
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t1").WithArguments("System.Nullable<T>", "T", "T11").WithLocation(4, 39));
98609
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t1").WithArguments("System.Nullable<T>", "T", "T11").WithLocation(15, 39));
110500
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(14, 37),
110506
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(15, 37),
110512
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(17, 37),
110518
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 37),
110524
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 37));
130922
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "U?").WithArguments("System.Nullable<T>", "T", "U").WithLocation(17, 19)
139103
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "value").WithArguments("System.Nullable<T>", "T", "T").WithLocation(15, 22));
139136
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "value").WithArguments("System.Nullable<T>", "T", "T").WithLocation(15, 22));
139491
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "value").WithArguments("System.Nullable<T>", "T", "T").WithLocation(12, 24));
150348
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(10, 37),
150436
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F1").WithArguments("System.Nullable<T>", "T", "T").WithLocation(4, 24),
150442
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F2").WithArguments("System.Nullable<T>", "T", "T").WithLocation(5, 24),
150448
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F3").WithArguments("System.Nullable<T>", "T", "T").WithLocation(6, 24),
150454
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F5").WithArguments("System.Nullable<T>", "T", "T").WithLocation(8, 24),
150460
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F7").WithArguments("System.Nullable<T>", "T", "T").WithLocation(10, 24),
150466
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F8").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 24));
150562
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F1").WithArguments("System.Nullable<T>", "T", "T").WithLocation(4, 24),
150571
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F2").WithArguments("System.Nullable<T>", "T", "T").WithLocation(5, 24),
150580
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F3").WithArguments("System.Nullable<T>", "T", "T").WithLocation(6, 24),
150589
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F5").WithArguments("System.Nullable<T>", "T", "T").WithLocation(8, 24),
150598
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F7").WithArguments("System.Nullable<T>", "T", "T").WithLocation(10, 24),
150607
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F8").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 24),
150837
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
150843
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
150858
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
150864
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
150885
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
150891
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
150906
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
150912
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
150965
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
150971
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
150986
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
150992
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
151045
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
151051
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
151066
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
151072
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
151122
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
151128
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
151140
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
151146
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
151208
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
151214
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
151229
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
151235
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
151288
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
151294
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
151309
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
151315
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
151377
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 35),
151383
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 35),
151395
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 35),
151401
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 35),
151479
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 24),
151485
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 24),
151515
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 25),
151524
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 25),
151581
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 24),
151587
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 24),
151602
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 25),
151608
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 25),
151661
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 29),
151667
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 29),
151682
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 30),
151688
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 30),
151750
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(9, 26),
151756
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(10, 26),
151768
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(19, 27),
151774
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "u").WithArguments("System.Nullable<T>", "T", "U").WithLocation(20, 27),
153471
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F1").WithArguments("System.Nullable<T>", "T", "T").WithLocation(4, 24),
153477
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F2").WithArguments("System.Nullable<T>", "T", "T").WithLocation(5, 24),
153483
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F3").WithArguments("System.Nullable<T>", "T", "T").WithLocation(6, 24),
153489
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F4").WithArguments("System.Nullable<T>", "T", "T").WithLocation(7, 24),
153495
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F5").WithArguments("System.Nullable<T>", "T", "T").WithLocation(8, 24),
153501
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F6").WithArguments("System.Nullable<T>", "T", "T").WithLocation(9, 24),
153525
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(13, 35),
153531
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(14, 35),
153537
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(15, 35),
153543
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(16, 35),
153549
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(17, 35),
153555
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "t").WithArguments("System.Nullable<T>", "T", "T").WithLocation(18, 35));
156512
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T?").WithLocation(11, 54),
156515
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 54)
156543
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T?").WithLocation(11, 52),
156546
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 52)
156577
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(11, 47)
Semantics\NullableTests.cs (4)
37
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Nullable<int>").WithArguments("System.Nullable<T>", "T", "int?"),
64
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "string").WithArguments("System.Nullable<T>", "T", "string").WithLocation(8, 14)
75
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "string").WithArguments("System.Nullable<T>", "T", "string").WithLocation(8, 14));
99
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "string").WithArguments("System.Nullable<T>", "T", "string").WithLocation(8, 18)
Semantics\OverloadResolutionTests.cs (15)
1470
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "ny").WithArguments("C.N<T>", "T", "Y").WithLocation(67, 36),
1473
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test1<string>").WithArguments("C.Test1<U>(U, C.N<U>)", "U", "string").WithLocation(17, 9),
1476
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test2").WithArguments("C.Test2<V>(V, C.N<V>)", "V", "string").WithLocation(21, 9),
1479
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test4").WithArguments("C.Test4<X>(X)", "X", "string").WithLocation(36, 9),
1482
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test5").WithArguments("C.N<T>", "T", "string").WithLocation(47, 9),
1485
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "string").WithArguments("C.L<S>", "S", "string").WithLocation(58, 17),
1488
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test6<L<string>>").WithArguments("C.L<S>", "S", "string").WithLocation(58, 9));
1493
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "ny").WithArguments("C.N<T>", "T", "Y").WithLocation(67, 36),
1496
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test1<string>").WithArguments("C.Test1<U>(U, C.N<U>)", "U", "string").WithLocation(17, 9),
1499
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test2").WithArguments("C.Test2<V>(V, C.N<V>)", "V", "string").WithLocation(21, 9),
1502
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test5").WithArguments("C.N<T>", "T", "string").WithLocation(47, 9),
1505
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "string").WithArguments("C.L<S>", "S", "string").WithLocation(58, 17),
1508
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Test6<L<string>>").WithArguments("C.L<S>", "S", "string").WithLocation(58, 9));
11891
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<object>").WithArguments("B.F<T>(T)", "T", "object").WithLocation(11, 35)
11919
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<object>").WithArguments("B.F<T>(T)", "T", "object").WithLocation(11, 9)
Semantics\RefFieldTests.cs (1)
20025
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "s").WithArguments("System.Nullable<T>", "T", "T").WithLocation(8, 27));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (56)
Symbols\GenericConstraintTests.cs (33)
349
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "o").WithArguments("A<T>", "T", "A<int>.B1[]").WithLocation(14, 31),
355
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "o").WithArguments("A<T>", "T", "string").WithLocation(9, 28),
361
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "o").WithArguments("A<T>", "T", "A<int>[]").WithLocation(11, 28),
364
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "o").WithArguments("A<T>", "T", "string").WithLocation(12, 30),
481
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C").WithArguments("I<T, U>", "U", "object").WithLocation(8, 7),
485
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "I<int, object>").WithArguments("I<T, U>", "U", "object").WithLocation(10, 10),
489
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "I<int, object>").WithArguments("I<T, U>", "U", "object").WithLocation(11, 12));
623
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C3").WithArguments("B.C<U>", "U", "T").WithLocation(23, 16),
625
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C3").WithArguments("B.I<U>", "U", "T").WithLocation(23, 16),
627
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F").WithArguments("B.C<U>", "U", "U").WithLocation(25, 30),
629
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "a").WithArguments("B.I<U>", "U", "U").WithLocation(25, 42),
631
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C4").WithArguments("B.C<U>", "U", "T").WithLocation(28, 16),
637
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "a").WithArguments("B.C<U>", "U", "U").WithLocation(30, 50),
647
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C6").WithArguments("B.I<U>", "U", "U").WithLocation(38, 16),
683
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "U").WithArguments("A<T>", "T", "V").WithLocation(10, 28),
685
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "U").WithArguments("A<T>", "T", "V").WithLocation(18, 28),
687
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "a").WithArguments("A<T>", "T", "U").WithLocation(8, 36),
689
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "b").WithArguments("A<T>", "T", "A<int>").WithLocation(8, 51),
691
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "M5").WithArguments("A<T>", "T", "U").WithLocation(11, 34));
813
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "A").WithArguments("I<T>", "T", "int?"),
896
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "object").WithArguments("A<T>", "T", "object").WithLocation(4, 31),
898
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<string>").WithArguments("B.F<T>(int)", "T", "string").WithLocation(8, 31));
1103
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "i.F").WithArguments("C.F<T>(T)", "T", "I").WithLocation(9, 9));
3695
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "IC1").WithArguments("IA1_1<T>", "T", "I").WithLocation(1, 11),
3704
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "IC2").WithArguments("IA2_1<T>", "T", "T").WithLocation(2, 11),
3713
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "IC3_1").WithArguments("IA3_1<T>", "T", "object").WithLocation(3, 11),
3716
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C2").WithArguments("IA2_1<T>", "T", "I").WithLocation(4, 7),
3725
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C3").WithArguments("IA3_1<T>", "T", "object").WithLocation(5, 7));
4454
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B1.B2<T, U>", "U", "A<T>").WithLocation(10, 10),
4460
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B1.B2<T, U>", "U", "A<T>").WithLocation(15, 13),
5710
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "Goo").WithArguments("System.Nullable<T>", "T", "T").WithLocation(12, 24),
6103
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C5").WithArguments("C<T>", "T", "C5").WithLocation(24, 19),
6105
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C6").WithArguments("C<T>", "T", "C6").WithLocation(25, 15));
Symbols\StaticAbstractMembersInInterfacesTests.cs (6)
22810
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C2").WithArguments("I1<T>", "T", "C2").WithLocation(12, 7),
22813
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "I1<C2>").WithArguments("I1<T>", "T", "C2").WithLocation(14, 19),
22816
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, op).WithArguments("I1<T>", "T", "C2").WithLocation(14, 35),
22819
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "x").WithArguments("I1<T>", "T", "C2").WithLocation(14, 44 + op.Length - 1)
30472
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "C2").WithArguments("I1<T>", "T", "C2").WithLocation(12, 7),
30475
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "I1<C2>").WithArguments("I1<T>", "T", "C2").WithLocation(14, 21)
Symbols\SymbolErrorTests.cs (17)
7658
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(9, 15),
7660
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(10, 9),
7662
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(14, 15),
7664
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(15, 9),
7666
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(24, 15),
7668
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(25, 9),
7670
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(29, 15),
7672
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(30, 9),
7674
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(34, 15),
7676
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(35, 9),
7678
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(39, 15),
7680
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(40, 9),
7682
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "int?").WithArguments("B<T>", "T", "int?").WithLocation(44, 15),
7684
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<int?>").WithArguments("C.F<U>()", "U", "int?").WithLocation(45, 9));
7733
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<U>").WithArguments("A<int?, object>.F<U>()", "U", "U").WithLocation(10, 9),
7735
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<U>").WithArguments("A<object, int?>.F<U>()", "U", "U").WithLocation(17, 9),
7737
Diagnostic(ErrorCode.
ERR_ValConstraintNotSatisfied
, "F<U>").WithArguments("A<object, T>.F<U>()", "U", "U").WithLocation(31, 9));