119 references to ERR_CannotInferDelegateType
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder_Expressions.cs (1)
427
diagnostics.Add(ErrorCode.
ERR_CannotInferDelegateType
, syntax.GetLocation());
Binder\Binder_Statements.cs (2)
2060
conversionError(diagnostics, ErrorCode.
ERR_CannotInferDelegateType
);
2506
Error(diagnostics, ErrorCode.
ERR_CannotInferDelegateType
, location);
Errors\ErrorFacts.cs (1)
2172
or ErrorCode.
ERR_CannotInferDelegateType
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (18)
FirstClassSpanTests.cs (6)
5012
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "x => a.M(x)").WithLocation(5, 10),
5024
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "x => a.M(x)").WithLocation(5, 10)
5116
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "x => a.M(x)").WithLocation(5, 10),
5125
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "x => a.M<int>(x)").WithLocation(8, 10),
5143
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "x => a.M(x)").WithLocation(5, 10),
5149
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "x => a.M<int>(x)").WithLocation(8, 10),
OverloadResolutionPriorityTests.cs (1)
1263
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "C.M").WithLocation(1, 9)
RefReadonlyParameterTests.cs (4)
7007
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "this.M").WithLocation(6, 17));
7032
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "this.M").WithLocation(6, 17));
7061
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "this.M").WithLocation(5, 17));
7066
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "this.M").WithLocation(5, 17));
Semantics\CollectionExpressionTests.cs (1)
449
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "() => []").WithLocation(6, 18));
Semantics\ExtensionTests.cs (6)
34791
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "int.M").WithLocation(1, 9));
34814
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "int.M").WithLocation(1, 9));
34890
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "42.M").WithLocation(1, 9));
34916
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "42.M").WithLocation(1, 9));
35009
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, @""""".M").WithLocation(7, 21));
35084
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, @"""ran"".M").WithLocation(1, 9));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (97)
Semantics\DelegateTypeTests.cs (85)
272
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F").WithLocation(9, 20),
275
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F").WithLocation(10, 24),
278
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F").WithLocation(11, 22),
281
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F").WithLocation(12, 31),
485
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(7, 24),
488
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(8, 31),
491
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(9, 26),
494
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(10, 28),
497
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(11, 32),
500
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(12, 34));
718
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, methodGroupOnly).WithLocation(6, 29 + offset)
886
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, anonymousFunction.StartsWith("delegate") ? "delegate" : "=>"));
929
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, anonymousFunction.StartsWith("delegate") ? "delegate" : "=>"));
987
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(5, 50));
1027
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(5, 59));
1072
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(6, 26),
1167
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, methodGroupOnly).WithLocation(5, 29 + offset)
1288
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, methodGroupOnly).WithLocation(5, 29 + offset)
1454
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F<int>").WithLocation(7, 34)
1506
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, methodGroupOnly).WithLocation(6, 29 + offset)
1586
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, methodGroupOnly).WithLocation(6, 29 + offset)
2023
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F<int>").WithLocation(9, 34)
2072
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(7, 9)
2129
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(4, 9)
2194
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(4, 9)
2204
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(4, 9)
2254
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(6, 9)
2437
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "C.M").WithLocation(4, 9));
2466
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "C.M").WithLocation(4, 9));
2512
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "C.M").WithLocation(4, 9));
2541
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "C.M").WithLocation(4, 9));
2585
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(1, 9)
2633
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(6, 9)
2681
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(6, 9)
2730
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M<int, int>").WithLocation(4, 9)
2820
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(2, 9)
2830
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(2, 9)
2904
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(1, 9));
2986
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(1, 9)
3043
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M<object?>").WithLocation(2, 9)
3168
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new object().F").WithLocation(1, 9));
3206
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().F<object>").WithLocation(1, 9));
3211
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().F<object>").WithLocation(1, 9));
3235
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().F<object>").WithLocation(1, 9));
3240
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().F<object>").WithLocation(1, 9));
3568
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F").WithLocation(7, 31),
3625
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F2").WithLocation(14, 13));
3652
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F2").WithLocation(14, 15));
3748
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F1").WithLocation(22, 15),
3751
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F2").WithLocation(23, 15));
3757
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F2").WithLocation(23, 15));
3840
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F1").WithLocation(11, 15),
3843
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F2").WithLocation(12, 15));
4179
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "Main").WithLocation(6, 13),
5185
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(9, 14),
5191
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(11, 14)
6588
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test1").WithLocation(7, 18),
6591
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test2").WithLocation(8, 18));
6672
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test1").WithLocation(7, 18),
6675
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test2").WithLocation(8, 18),
6762
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test1").WithLocation(7, 18),
6765
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test2").WithLocation(8, 18),
6807
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test1").WithLocation(7, 18),
6810
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test2").WithLocation(8, 18));
6846
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test1").WithLocation(7, 18),
6849
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test2").WithLocation(8, 18));
6913
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Y<int>().M").WithLocation(1, 10)
7098
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(20, 21));
7236
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(20, 21));
7272
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(13, 17));
7308
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(13, 17));
7357
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(19, 21));
7400
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(19, 21));
8224
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(6, 25),
8227
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(7, 25),
8252
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(6, 25),
8255
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(7, 25),
10615
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F").WithLocation(7, 18),
10618
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "x => x").WithLocation(8, 18));
11862
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F").WithLocation(6, 18),
11865
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "ref void () => { }").WithLocation(7, 19),
13745
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new D().M").WithLocation(4, 9));
13812
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new D().M").WithLocation(4, 9));
13862
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new D<long>().M").WithLocation(1, 9)
13943
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new D<long>().M").WithLocation(1, 9)
Semantics\InterpolationTests.cs (1)
1003
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(5, 36),
Semantics\LambdaTests.cs (3)
5463
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(8, 42),
7176
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "(x = 7) => x").WithLocation(5, 20),
7198
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "(string s = null, x = 7, double d = 3.14) => { }").WithLocation(5, 19),
Semantics\NullableReferenceTypesTests.cs (2)
65607
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "x => x").WithLocation(5, 17));
65627
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "y => y ?? x.ToString()").WithLocation(5, 17),
Semantics\RawInterpolationTests.cs (1)
1003
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(5, 38),
Semantics\RefFieldTests.cs (2)
11332
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "(scoped scoped R r) => { }").WithLocation(6, 18),
11376
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "(scoped scoped R r) => { }").WithLocation(6, 18),
Semantics\SemanticErrorTests.cs (3)
12128
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "s => -1").WithLocation(7, 17),
12152
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "s => -1").WithLocation(5, 9),
23836
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "(a) => a").WithLocation(5, 26));