125 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 (25)
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 (13)
36909
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new object().M<int>").WithLocation(1, 9)];
37163
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new object().M<int>").WithLocation(1, 9));
37190
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "object.M").WithLocation(1, 9)];
37228
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new object().M").WithLocation(1, 9)];
37258
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "object.M").WithLocation(1, 9)];
37981
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "int.M").WithLocation(1, 9));
38004
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "int.M").WithLocation(1, 9));
38080
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "42.M").WithLocation(1, 9));
38106
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "42.M").WithLocation(1, 9));
38199
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, @""""".M").WithLocation(7, 21));
38274
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, @"""ran"".M").WithLocation(1, 9));
38355
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(1, 9));
38406
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(1, 9));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (96)
Semantics\DelegateTypeTests.cs (84)
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)
2453
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "C.M").WithLocation(4, 9));
2463
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "C.M").WithLocation(4, 9));
2515
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "C.M").WithLocation(4, 9));
2559
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(1, 9)
2607
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(6, 9)
2655
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(6, 9)
2704
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M<int, int>").WithLocation(4, 9)
2794
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(2, 9)
2804
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(2, 9)
2878
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(1, 9));
2960
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(1, 9)
3017
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M<object?>").WithLocation(2, 9)
3142
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new object().F").WithLocation(1, 9));
3180
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().F<object>").WithLocation(1, 9));
3185
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().F<object>").WithLocation(1, 9));
3209
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().F<object>").WithLocation(1, 9));
3214
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().F<object>").WithLocation(1, 9));
3542
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F").WithLocation(7, 31),
3599
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F2").WithLocation(14, 13));
3626
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F2").WithLocation(14, 15));
3722
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F1").WithLocation(22, 15),
3725
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F2").WithLocation(23, 15));
3731
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F2").WithLocation(23, 15));
3814
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F1").WithLocation(11, 15),
3817
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F2").WithLocation(12, 15));
4153
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "Main").WithLocation(6, 13),
5159
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(9, 14),
5165
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(11, 14)
6562
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test1").WithLocation(7, 18),
6565
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test2").WithLocation(8, 18));
6646
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test1").WithLocation(7, 18),
6649
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test2").WithLocation(8, 18),
6736
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test1").WithLocation(7, 18),
6739
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test2").WithLocation(8, 18),
6781
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test1").WithLocation(7, 18),
6784
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test2").WithLocation(8, 18));
6820
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test1").WithLocation(7, 18),
6823
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Program().Test2").WithLocation(8, 18));
6887
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new Y<int>().M").WithLocation(1, 10)
7072
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(20, 21));
7210
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(20, 21));
7246
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(13, 17));
7282
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(13, 17));
7331
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(19, 21));
7374
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new C().M").WithLocation(19, 21));
8198
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(6, 25),
8201
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(7, 25),
8226
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(6, 25),
8229
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "=>").WithLocation(7, 25),
10589
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F").WithLocation(7, 18),
10592
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "x => x").WithLocation(8, 18));
11836
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "F").WithLocation(6, 18),
11839
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "ref void () => { }").WithLocation(7, 19),
13719
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new D().M").WithLocation(4, 9));
13786
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new D().M").WithLocation(4, 9));
13836
Diagnostic(ErrorCode.
ERR_CannotInferDelegateType
, "new D<long>().M").WithLocation(1, 9)
13917
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));