79 references to ERR_NewConstraintNotSatisfied
Microsoft.CodeAnalysis.CSharp (2)
Errors\ErrorFacts.cs (1)
854
or ErrorCode.
ERR_NewConstraintNotSatisfied
Symbols\ConstraintsHelper.cs (1)
1130
diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.
ERR_NewConstraintNotSatisfied
, containingSymbol.ConstructedFrom(), typeParameter, typeArgument.Type))));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\UnmanagedTypeModifierTests.cs (1)
1274
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<string>").WithArguments("TestRef.M<T>()", "T", "string").WithLocation(7, 23),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (51)
Semantics\BindingAsyncTasklikeMoreTests.cs (1)
1423
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "await new MyTask();").WithArguments("MyTaskMethodBuilder.AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter, ref TStateMachine)", "TAwaiter", "MyTask.Awaiter").WithLocation(5, 9));
Semantics\GenericConstraintsTests.cs (12)
181
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "string").WithArguments("Test<T>", "T", "string").WithLocation(15, 26),
184
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "System.Enum").WithArguments("Test<T>", "T", "System.Enum").WithLocation(16, 26));
337
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "string").WithArguments("Test<T>", "T", "string").WithLocation(13, 26),
340
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "System.Enum").WithArguments("Test<T>", "T", "System.Enum").WithLocation(14, 26));
799
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "D1").WithArguments("Test<T>", "T", "D1").WithLocation(10, 26),
808
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "string").WithArguments("Test<T>", "T", "string").WithLocation(12, 26));
889
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "D1").WithArguments("Test<T>", "T", "D1").WithLocation(7, 26),
898
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "string").WithArguments("Test<T>", "T", "string").WithLocation(9, 26));
1280
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "D1").WithArguments("Test<T>", "T", "D1").WithLocation(10, 26),
1289
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "string").WithArguments("Test<T>", "T", "string").WithLocation(12, 26));
1370
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "D1").WithArguments("Test<T>", "T", "D1").WithLocation(7, 26),
1379
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "string").WithArguments("Test<T>", "T", "string").WithLocation(9, 26));
Semantics\SemanticErrorTests.cs (37)
9870
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<B>").WithArguments("C<T, U>.M<V>()", "V", "B").WithLocation(14, 9),
9872
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<D>").WithArguments("C<T, U>.M<V>()", "V", "D").WithLocation(15, 9),
9874
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<U>").WithArguments("C<T, U>.M<V>()", "V", "U").WithLocation(21, 9),
9876
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<B, B>").WithArguments("C<T, U>.M<V, W>()", "V", "B").WithLocation(22, 9),
9878
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<B, B>").WithArguments("C<T, U>.M<V, W>()", "W", "B").WithLocation(22, 9),
9880
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<T, U>").WithArguments("C<T, U>.M<V, W>()", "W", "U").WithLocation(23, 9),
9882
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<T[]>").WithArguments("C<T, U>.M<V>()", "V", "T[]").WithLocation(25, 9));
9942
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "d").WithArguments("D<T>", "T", "U").WithLocation(9, 36),
9945
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<B>").WithArguments("C<A>.M<U>()", "U", "B").WithLocation(29, 14),
9948
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "B").WithArguments("C<T>", "T", "B").WithLocation(30, 11),
9951
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "B").WithArguments("C<T>", "T", "B").WithLocation(31, 11),
9954
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<B>").WithArguments("C<B>.M<U>()", "U", "B").WithLocation(31, 14),
9957
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "G").WithArguments("C<T>", "T", "G").WithLocation(32, 11),
9960
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<G>").WithArguments("C<H>.M<U>()", "U", "G").WithLocation(33, 14),
9963
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "I").WithArguments("C<T>", "T", "I").WithLocation(34, 11),
9966
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "F").WithArguments("E.F<T>(D<T>)", "T", "B").WithLocation(36, 11),
9969
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "B").WithArguments("C<T>", "T", "B").WithLocation(38, 19),
10004
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "F").WithArguments("C<T>", "T", "B").WithLocation(38, 11),
10008
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<B>").WithArguments("E.M<T>(object)", "T", "B").WithLocation(41, 11),
10011
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "B").WithArguments("F<T, U>", "U", "B").WithLocation(42, 22));
10052
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M").WithArguments("C<T, U>.M<V>(V)", "V", "B").WithLocation(15, 9),
10055
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "E").WithArguments("S.E<T>(T)", "T", "B").WithLocation(16, 11),
10058
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M").WithArguments("C<T, U>.M<V>(V)", "V", "T").WithLocation(18, 9),
10061
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "E").WithArguments("S.E<T>(T)", "T", "T").WithLocation(19, 11)
10112
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "CB").WithArguments("N.C<T>", "T", "N.B").WithLocation(4, 7),
10115
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "CBD").WithArguments("N.C<T>", "T", "N.B").WithLocation(8, 11),
10118
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<N.B>").WithArguments("N.C<N.A>.M<U>()", "U", "N.B").WithLocation(24, 20),
10121
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "NB").WithArguments("N.C<T>", "T", "N.B").WithLocation(25, 15),
10124
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "C<N.A>.D").WithArguments("N.C<T>", "T", "N.C<N.A>.D").WithLocation(26, 15),
10127
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<N.B>").WithArguments("N.C<N.A>.D.M<U>()", "U", "N.B").WithLocation(27, 22),
10130
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "N.B").WithArguments("N.C<T>", "T", "N.B").WithLocation(28, 15),
10133
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<N.B>").WithArguments("N.C<N.A>.M<U>()", "U", "N.B").WithLocation(29, 16),
10136
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "M<N.B>").WithArguments("N.C<N.A>.D.M<U>()", "U", "N.B").WithLocation(31, 17),
10139
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "CAD").WithArguments("N.C<T>", "T", "N.C<N.A>.D").WithLocation(33, 15),
10142
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "CBD").WithArguments("N.C<T>", "T", "N.C<N.B>.D").WithLocation(34, 15));
10176
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "B").WithArguments("D<T>", "T", "B").WithLocation(18, 11),
10178
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "C").WithArguments("D<T>", "T", "C").WithLocation(19, 11));
Semantics\StructConstructorTests.cs (1)
244
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "CreateNew<S>").WithArguments("Program.CreateNew<T>()", "T", "S").WithLocation(8, 13),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (25)
Symbols\GenericConstraintTests.cs (25)
295
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "PrivateCtorClass").WithArguments("Gen<T>", "T", "PrivateCtorClass").WithLocation(5, 26));
521
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "B").WithArguments("A.I<T>", "T", "B").WithLocation(12, 16),
523
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "A.I<B>").WithArguments("A.I<T>", "T", "B").WithLocation(14, 10),
525
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "A.I<B>").WithArguments("A.I<T>", "T", "B").WithLocation(15, 12),
527
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "A.I<B>").WithArguments("A.I<T>", "T", "B").WithLocation(16, 12),
529
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "A.I<B>").WithArguments("A.I<T>", "T", "B").WithLocation(17, 13));
822
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "B2").WithArguments("C<int>.D2<U>", "U", "string"),
1016
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "C<T>").WithArguments("C<T>", "T", "C<T>").WithLocation(4, 19));
1101
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "i.E").WithArguments("C.E<T>(T)", "T", "I").WithLocation(7, 9),
6146
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "E").WithArguments("D<T>", "T", "B").WithLocation(3, 16),
6148
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "E").WithArguments("D<T>", "T", "C").WithLocation(13, 16),
6178
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "B").WithArguments("D<T>", "T", "B").WithLocation(3, 32));
6202
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "C").WithArguments("I<T>", "T", "C").WithLocation(6, 7),
6204
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "I<C>").WithArguments("I<T>", "T", "C").WithLocation(9, 16));
6266
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "B2").WithArguments("IB<T>", "T", "B2").WithLocation(24, 7),
6268
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "A2").WithArguments("IA<T>", "T", "A2").WithLocation(14, 7),
6270
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "A1").WithArguments("IA<T>", "T", "A1").WithLocation(9, 7),
6272
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "B1").WithArguments("IB<T>", "T", "B1").WithLocation(19, 7),
6274
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "IB<B1>").WithArguments("IB<T>", "T", "B1").WithLocation(22, 12),
6276
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "i").WithArguments("IB<T>", "T", "B1").WithLocation(22, 31),
6278
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "IA<A1>").WithArguments("IA<T>", "T", "A1").WithLocation(12, 12),
6280
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "P").WithArguments("IA<T>", "T", "A1").WithLocation(12, 19),
6282
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "P").WithArguments("IA<T>", "T", "A2").WithLocation(17, 19),
6284
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "i").WithArguments("IB<T>", "T", "B2").WithLocation(27, 31));
7443
Diagnostic(ErrorCode.
ERR_NewConstraintNotSatisfied
, "Base").WithArguments("ISetup<T>", "T", "N").WithLocation(5, 11)