125 references to ERR_CannotInferDelegateType
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder_Expressions.cs (1)
427diagnostics.Add(ErrorCode.ERR_CannotInferDelegateType, syntax.GetLocation());
Binder\Binder_Statements.cs (2)
2060conversionError(diagnostics, ErrorCode.ERR_CannotInferDelegateType); 2506Error(diagnostics, ErrorCode.ERR_CannotInferDelegateType, location);
Errors\ErrorFacts.cs (1)
2172or ErrorCode.ERR_CannotInferDelegateType
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (25)
FirstClassSpanTests.cs (6)
5012Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => a.M(x)").WithLocation(5, 10), 5024Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => a.M(x)").WithLocation(5, 10) 5116Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => a.M(x)").WithLocation(5, 10), 5125Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => a.M<int>(x)").WithLocation(8, 10), 5143Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => a.M(x)").WithLocation(5, 10), 5149Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => a.M<int>(x)").WithLocation(8, 10),
OverloadResolutionPriorityTests.cs (1)
1263Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "C.M").WithLocation(1, 9)
RefReadonlyParameterTests.cs (4)
7007Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "this.M").WithLocation(6, 17)); 7032Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "this.M").WithLocation(6, 17)); 7061Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "this.M").WithLocation(5, 17)); 7066Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "this.M").WithLocation(5, 17));
Semantics\CollectionExpressionTests.cs (1)
449Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "() => []").WithLocation(6, 18));
Semantics\ExtensionTests.cs (13)
36909Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new object().M<int>").WithLocation(1, 9)]; 37163Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new object().M<int>").WithLocation(1, 9)); 37190Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "object.M").WithLocation(1, 9)]; 37228Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new object().M").WithLocation(1, 9)]; 37258Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "object.M").WithLocation(1, 9)]; 37981Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "int.M").WithLocation(1, 9)); 38004Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "int.M").WithLocation(1, 9)); 38080Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "42.M").WithLocation(1, 9)); 38106Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "42.M").WithLocation(1, 9)); 38199Diagnostic(ErrorCode.ERR_CannotInferDelegateType, @""""".M").WithLocation(7, 21)); 38274Diagnostic(ErrorCode.ERR_CannotInferDelegateType, @"""ran"".M").WithLocation(1, 9)); 38355Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(1, 9)); 38406Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(1, 9));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (96)
Semantics\DelegateTypeTests.cs (84)
272Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(9, 20), 275Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(10, 24), 278Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(11, 22), 281Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(12, 31), 485Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(7, 24), 488Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(8, 31), 491Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(9, 26), 494Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(10, 28), 497Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(11, 32), 500Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(12, 34)); 718Diagnostic(ErrorCode.ERR_CannotInferDelegateType, methodGroupOnly).WithLocation(6, 29 + offset) 886Diagnostic(ErrorCode.ERR_CannotInferDelegateType, anonymousFunction.StartsWith("delegate") ? "delegate" : "=>")); 929Diagnostic(ErrorCode.ERR_CannotInferDelegateType, anonymousFunction.StartsWith("delegate") ? "delegate" : "=>")); 987Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(5, 50)); 1027Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(5, 59)); 1072Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(6, 26), 1167Diagnostic(ErrorCode.ERR_CannotInferDelegateType, methodGroupOnly).WithLocation(5, 29 + offset) 1288Diagnostic(ErrorCode.ERR_CannotInferDelegateType, methodGroupOnly).WithLocation(5, 29 + offset) 1454Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F<int>").WithLocation(7, 34) 1506Diagnostic(ErrorCode.ERR_CannotInferDelegateType, methodGroupOnly).WithLocation(6, 29 + offset) 1586Diagnostic(ErrorCode.ERR_CannotInferDelegateType, methodGroupOnly).WithLocation(6, 29 + offset) 2023Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F<int>").WithLocation(9, 34) 2072Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(7, 9) 2129Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(4, 9) 2194Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(4, 9) 2204Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(4, 9) 2254Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(6, 9) 2453Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "C.M").WithLocation(4, 9)); 2463Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "C.M").WithLocation(4, 9)); 2515Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "C.M").WithLocation(4, 9)); 2559Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(1, 9) 2607Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(6, 9) 2655Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(6, 9) 2704Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M<int, int>").WithLocation(4, 9) 2794Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(2, 9) 2804Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(2, 9) 2878Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(1, 9)); 2960Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(1, 9) 3017Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M<object?>").WithLocation(2, 9) 3142Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new object().F").WithLocation(1, 9)); 3180Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().F<object>").WithLocation(1, 9)); 3185Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().F<object>").WithLocation(1, 9)); 3209Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().F<object>").WithLocation(1, 9)); 3214Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().F<object>").WithLocation(1, 9)); 3542Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(7, 31), 3599Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(14, 13)); 3626Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(14, 15)); 3722Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F1").WithLocation(22, 15), 3725Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(23, 15)); 3731Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(23, 15)); 3814Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F1").WithLocation(11, 15), 3817Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(12, 15)); 4153Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "Main").WithLocation(6, 13), 5159Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(9, 14), 5165Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(11, 14) 6562Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test1").WithLocation(7, 18), 6565Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test2").WithLocation(8, 18)); 6646Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test1").WithLocation(7, 18), 6649Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test2").WithLocation(8, 18), 6736Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test1").WithLocation(7, 18), 6739Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test2").WithLocation(8, 18), 6781Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test1").WithLocation(7, 18), 6784Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test2").WithLocation(8, 18)); 6820Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test1").WithLocation(7, 18), 6823Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test2").WithLocation(8, 18)); 6887Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Y<int>().M").WithLocation(1, 10) 7072Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(20, 21)); 7210Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(20, 21)); 7246Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(13, 17)); 7282Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(13, 17)); 7331Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(19, 21)); 7374Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(19, 21)); 8198Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(6, 25), 8201Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(7, 25), 8226Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(6, 25), 8229Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(7, 25), 10589Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(7, 18), 10592Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => x").WithLocation(8, 18)); 11836Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(6, 18), 11839Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "ref void () => { }").WithLocation(7, 19), 13719Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new D().M").WithLocation(4, 9)); 13786Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new D().M").WithLocation(4, 9)); 13836Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new D<long>().M").WithLocation(1, 9) 13917Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new D<long>().M").WithLocation(1, 9)
Semantics\InterpolationTests.cs (1)
1003Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(5, 36),
Semantics\LambdaTests.cs (3)
5463Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(8, 42), 7176Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "(x = 7) => x").WithLocation(5, 20), 7198Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "(string s = null, x = 7, double d = 3.14) => { }").WithLocation(5, 19),
Semantics\NullableReferenceTypesTests.cs (2)
65607Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => x").WithLocation(5, 17)); 65627Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "y => y ?? x.ToString()").WithLocation(5, 17),
Semantics\RawInterpolationTests.cs (1)
1003Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(5, 38),
Semantics\RefFieldTests.cs (2)
11332Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "(scoped scoped R r) => { }").WithLocation(6, 18), 11376Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "(scoped scoped R r) => { }").WithLocation(6, 18),
Semantics\SemanticErrorTests.cs (3)
12128Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "s => -1").WithLocation(7, 17), 12152Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "s => -1").WithLocation(5, 9), 23836Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "(a) => a").WithLocation(5, 26));