119 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 (18)
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 (6)
34791Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "int.M").WithLocation(1, 9)); 34814Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "int.M").WithLocation(1, 9)); 34890Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "42.M").WithLocation(1, 9)); 34916Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "42.M").WithLocation(1, 9)); 35009Diagnostic(ErrorCode.ERR_CannotInferDelegateType, @""""".M").WithLocation(7, 21)); 35084Diagnostic(ErrorCode.ERR_CannotInferDelegateType, @"""ran"".M").WithLocation(1, 9));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (97)
Semantics\DelegateTypeTests.cs (85)
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) 2437Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "C.M").WithLocation(4, 9)); 2466Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "C.M").WithLocation(4, 9)); 2512Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "C.M").WithLocation(4, 9)); 2541Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "C.M").WithLocation(4, 9)); 2585Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(1, 9) 2633Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(6, 9) 2681Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(6, 9) 2730Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M<int, int>").WithLocation(4, 9) 2820Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(2, 9) 2830Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(2, 9) 2904Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(1, 9)); 2986Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(1, 9) 3043Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M<object?>").WithLocation(2, 9) 3168Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new object().F").WithLocation(1, 9)); 3206Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().F<object>").WithLocation(1, 9)); 3211Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().F<object>").WithLocation(1, 9)); 3235Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().F<object>").WithLocation(1, 9)); 3240Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().F<object>").WithLocation(1, 9)); 3568Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(7, 31), 3625Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(14, 13)); 3652Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(14, 15)); 3748Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F1").WithLocation(22, 15), 3751Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(23, 15)); 3757Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(23, 15)); 3840Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F1").WithLocation(11, 15), 3843Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(12, 15)); 4179Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "Main").WithLocation(6, 13), 5185Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(9, 14), 5191Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(11, 14) 6588Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test1").WithLocation(7, 18), 6591Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test2").WithLocation(8, 18)); 6672Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test1").WithLocation(7, 18), 6675Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test2").WithLocation(8, 18), 6762Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test1").WithLocation(7, 18), 6765Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test2").WithLocation(8, 18), 6807Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test1").WithLocation(7, 18), 6810Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test2").WithLocation(8, 18)); 6846Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test1").WithLocation(7, 18), 6849Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Program().Test2").WithLocation(8, 18)); 6913Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new Y<int>().M").WithLocation(1, 10) 7098Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(20, 21)); 7236Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(20, 21)); 7272Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(13, 17)); 7308Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(13, 17)); 7357Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(19, 21)); 7400Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new C().M").WithLocation(19, 21)); 8224Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(6, 25), 8227Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(7, 25), 8252Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(6, 25), 8255Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(7, 25), 10615Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(7, 18), 10618Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => x").WithLocation(8, 18)); 11862Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(6, 18), 11865Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "ref void () => { }").WithLocation(7, 19), 13745Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new D().M").WithLocation(4, 9)); 13812Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new D().M").WithLocation(4, 9)); 13862Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "new D<long>().M").WithLocation(1, 9) 13943Diagnostic(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));