113 references to ERR_RefConstraintNotSatisfied
Microsoft.CodeAnalysis.CSharp (2)
Errors\ErrorFacts.cs (1)
840
case ErrorCode.
ERR_RefConstraintNotSatisfied
:
Symbols\ConstraintsHelper.cs (1)
900
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)
2573
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "0").WithArguments("(T1, T2)", "T1", "int").WithLocation(6, 30),
2576
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "0").WithArguments("(T1, T2)", "T1", "int").WithLocation(6, 30),
2579
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "1").WithArguments("(T1, T2)", "T2", "int").WithLocation(6, 33),
2582
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "1").WithArguments("(T1, T2)", "T2", "int").WithLocation(6, 33),
2585
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "this").WithArguments("(T1, T2)", "T1", "int").WithLocation(7, 30),
2588
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "this").WithArguments("(T1, T2)", "T2", "int").WithLocation(7, 36)
CodeGen\CodeGenTupleTest.cs (16)
10372
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "p").WithArguments("(T1, T2)", "T2", "int").WithLocation(14, 33),
10375
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "2").WithArguments("(T1, T2)", "T2", "int").WithLocation(16, 22),
10378
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("(T1, T2)", "T2", "int").WithLocation(17, 15)
10453
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M").WithArguments("(T1, T2)", "T2", "U").WithLocation(15, 12),
10456
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "field").WithArguments("(T1, T2)", "T2", "T").WithLocation(14, 18),
10459
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "U").WithArguments("(T1, T2)", "T2", "U").WithLocation(19, 28),
10494
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("C<T>", "T", "int").WithLocation(17, 24),
10497
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M").WithArguments("C<T>.M<U>(U)", "U", "int").WithLocation(18, 18),
10538
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("C<T>", "T", "int").WithLocation(17, 24),
10541
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M").WithArguments("C<T>.M<U>(U)", "U", "(int, int)").WithLocation(18, 18),
10605
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "p").WithArguments("System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>", "TRest", "System.ValueTuple<int>").WithLocation(42, 53),
10608
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "p").WithArguments("System.ValueTuple<T1>", "T1", "int").WithLocation(42, 53),
10611
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),
10614
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "8").WithArguments("System.ValueTuple<T1>", "T1", "int").WithLocation(44, 40),
10617
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),
10620
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("System.ValueTuple<T1>", "T1", "int").WithLocation(45, 45)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\UnmanagedTypeModifierTests.cs (1)
1148
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "M<int>").WithArguments("TestRef.M<T>()", "T", "int").WithLocation(6, 23),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (32)
Semantics\BindingTests.cs (2)
3408
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "A<A<int>[]>.B").WithArguments("A<T>", "T", "int").WithLocation(2, 14));
3424
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "A<int, string>").WithArguments("A<T, U>", "T", "int").WithLocation(2, 14),
Semantics\DynamicTests.cs (2)
1449
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "c.Goo<short>(d, d)").WithArguments("C.Goo<T>(int, int)", "T", "short").WithLocation(15, 19)
1460
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\NullableReferenceTypesTests.cs (6)
152930
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "FTC<TQ?>").WithArguments("C.FTC<TC>(TC)", "TC", "TQ").WithLocation(13, 11),
152936
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "FTCO<TQ?>").WithArguments("C.FTCO<TCO>(TCO)", "TCO", "TQ").WithLocation(18, 20),
152948
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "FTC<T>").WithArguments("C.FTC<TC>(TC)", "TC", "T").WithLocation(33, 11),
152957
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "FTCO<T>").WithArguments("C.FTCO<TCO>(TCO)", "TCO", "T").WithLocation(38, 11),
152975
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "FTC<TO>").WithArguments("C.FTC<TC>(TC)", "TC", "TO").WithLocation(76, 11),
152978
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)
2960
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("R<T>", "T", "int").WithLocation(9, 19),
2963
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("R2<T>", "T", "int").WithLocation(10, 20)
Semantics\RecordTests.cs (2)
25654
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("R<T>", "T", "int").WithLocation(9, 19),
25657
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("R2<T>", "T", "int").WithLocation(10, 20)
Semantics\SemanticErrorTests.cs (1)
10895
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)
477
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C").WithArguments("I<T, U>", "T", "int").WithLocation(8, 7),
481
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "I<int, object>").WithArguments("I<T, U>", "T", "int").WithLocation(10, 10),
485
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "I<int, object>").WithArguments("I<T, U>", "T", "int").WithLocation(11, 12),
605
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C1").WithArguments("A<T>", "T", "T").WithLocation(13, 16),
607
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C1").WithArguments("I<T>", "T", "T").WithLocation(13, 16),
609
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F").WithArguments("A<T>", "T", "U").WithLocation(15, 28),
611
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "a").WithArguments("I<T>", "T", "U").WithLocation(15, 38),
613
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C2").WithArguments("A<T>", "T", "T").WithLocation(18, 16),
615
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C2").WithArguments("A<T>", "T", "T").WithLocation(18, 16),
617
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F").WithArguments("A<T>", "T", "U").WithLocation(20, 30),
619
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "a").WithArguments("A<T>", "T", "U").WithLocation(20, 42),
631
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C4").WithArguments("A<T>", "T", "T").WithLocation(28, 16),
633
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F").WithArguments("A<T>", "T", "U").WithLocation(30, 33),
637
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C5").WithArguments("I<T>", "T", "T").WithLocation(33, 16),
639
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C5").WithArguments("A<T>", "T", "T").WithLocation(33, 16),
641
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F").WithArguments("A<T>", "T", "U").WithLocation(35, 31),
643
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "a").WithArguments("I<T>", "T", "U").WithLocation(35, 44),
647
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "b").WithArguments("A<T>", "T", "Y").WithLocation(40, 54));
785
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "A").WithArguments("C<T>", "T", "int").WithLocation(1, 7),
787
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "B").WithArguments("C<T>", "T", "bool").WithLocation(2, 7),
817
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "B2").WithArguments("C<T>", "T", "int"),
859
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "float").WithArguments("B<T>", "T", "float").WithLocation(11, 18),
863
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F").WithArguments("B<T>", "T", "byte").WithLocation(10, 20),
865
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "o").WithArguments("B<T>", "T", "double").WithLocation(12, 19),
867
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int").WithArguments("B<T>", "T", "int").WithLocation(8, 14),
871
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "short").WithArguments("B<T>", "T", "short").WithLocation(9, 22),
958
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "E").WithArguments("I<T>", "T", "short").WithLocation(8, 23),
961
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "i").WithArguments("I<T>", "T", "int").WithLocation(5, 14),
964
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "P").WithArguments("I<T>", "T", "byte").WithLocation(6, 13),
967
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "index").WithArguments("I<T>", "T", "float").WithLocation(7, 29),
970
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "this").WithArguments("I<T>", "T", "double").WithLocation(7, 15),
991
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "long").WithArguments("I<T>", "T", "long").WithLocation(6, 21),
995
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "short").WithArguments("I<T>", "T", "short").WithLocation(7, 13),
4450
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("A<T>", "T", "int").WithLocation(9, 10),
4454
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "U").WithArguments("A<T>", "T", "int").WithLocation(11, 13),
4456
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("A<T>", "T", "int").WithLocation(14, 13),
4460
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "U").WithArguments("A<T>", "T", "int").WithLocation(16, 16));
Symbols\StaticAbstractMembersInInterfacesTests.cs (4)
22341
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "C2").WithArguments("I1<T>", "T", "C2").WithLocation(12, 8),
22344
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "I1<C2>").WithArguments("I1<T>", "T", "C2").WithLocation(14, 19),
22347
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, op).WithArguments("I1<T>", "T", "C2").WithLocation(14, 35),
22350
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "x").WithArguments("I1<T>", "T", "C2").WithLocation(14, 44 + op.Length - 1)
Symbols\SymbolErrorTests.cs (12)
7504
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(9, 15),
7506
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(10, 9),
7508
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(19, 15),
7510
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(20, 9),
7512
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(24, 15),
7514
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(25, 9),
7516
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(29, 15),
7518
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(30, 9),
7520
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "T").WithArguments("B<T>", "T", "T").WithLocation(39, 15),
7522
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "F<T>").WithArguments("C.F<U>()", "U", "T").WithLocation(40, 9),
7524
Diagnostic(ErrorCode.
ERR_RefConstraintNotSatisfied
, "int?").WithArguments("B<T>", "T", "int?").WithLocation(44, 15),
7526
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")