53 references to ERR_CannotInferDelegateType
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder_Expressions.cs (1)
410diagnostics.Add(ErrorCode.ERR_CannotInferDelegateType, syntax.GetLocation());
Binder\Binder_Statements.cs (2)
2015Error(diagnostics, ErrorCode.ERR_CannotInferDelegateType, syntax); 2450Error(diagnostics, ErrorCode.ERR_CannotInferDelegateType, location);
Errors\ErrorFacts.cs (1)
2115case ErrorCode.ERR_CannotInferDelegateType:
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (49)
Semantics\DelegateTypeTests.cs (37)
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, "x => x").WithLocation(7, 22), 488Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => x").WithLocation(8, 29), 491Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => x").WithLocation(9, 24), 494Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => x").WithLocation(10, 26), 497Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => x").WithLocation(11, 30), 500Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => x").WithLocation(12, 32)); 718Diagnostic(ErrorCode.ERR_CannotInferDelegateType, methodGroupOnly).WithLocation(6, 29 + offset) 886Diagnostic(ErrorCode.ERR_CannotInferDelegateType, anonymousFunction).WithLocation(5, 29)); 929Diagnostic(ErrorCode.ERR_CannotInferDelegateType, anonymousFunction).WithLocation(5, 38)); 987Diagnostic(ErrorCode.ERR_CannotInferDelegateType, anonymousFunction).WithLocation(5, 48)); 1027Diagnostic(ErrorCode.ERR_CannotInferDelegateType, anonymousFunction).WithLocation(5, 57)); 1072Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x0 => { _ = x0.Length; object y0 = 0; _ = y0.Length; }").WithLocation(6, 23), 1175Diagnostic(ErrorCode.ERR_CannotInferDelegateType, methodGroupOnly).WithLocation(5, 29 + offset) 1269Diagnostic(ErrorCode.ERR_CannotInferDelegateType, methodGroupOnly).WithLocation(5, 29 + offset) 1360Diagnostic(ErrorCode.ERR_CannotInferDelegateType, methodGroupOnly).WithLocation(6, 29 + offset) 1711Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(7, 31), 1768Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(14, 13)); 1795Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(14, 15)); 1870Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F1").WithLocation(22, 15), 1873Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(23, 15)); 1956Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F1").WithLocation(11, 15), 1959Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F2").WithLocation(12, 15)); 2295Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "Main").WithLocation(6, 13), 3301Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => x").WithLocation(9, 12), 3307Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => x").WithLocation(11, 12) 5411Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "(bool b) => { if (b) return null; }").WithLocation(6, 16), 5414Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "(bool b) => { if (b) return; else return null; }").WithLocation(7, 16), 5439Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "(bool b) => { if (b) return default; }").WithLocation(6, 16), 5442Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "(bool b) => { if (b) return; else return default; }").WithLocation(7, 16), 7802Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(7, 18), 7805Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => x").WithLocation(8, 18)); 9036Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "F").WithLocation(6, 18), 9039Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "ref void () => { }").WithLocation(7, 19),
Semantics\InterpolationTests.cs (1)
1004Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x=>3").WithLocation(5, 35),
Semantics\LambdaTests.cs (5)
5322Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "ref void () => { }").WithLocation(7, 14), 5328Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "ref readonly void () => { }").WithLocation(8, 14), 5424Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "async ref Task (s) => { _ = s.Length; await Task.Yield(); }").WithLocation(8, 23), 7147Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "(x = 7) => x").WithLocation(5, 20), 7169Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "(string s = null, x = 7, double d = 3.14) => { }").WithLocation(5, 19),
Semantics\NullableReferenceTypesTests.cs (2)
63088Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x => x").WithLocation(5, 17)); 63108Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "y => y ?? x.ToString()").WithLocation(5, 17),
Semantics\RawInterpolationTests.cs (1)
1003Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "x=>3").WithLocation(5, 37),
Semantics\SemanticErrorTests.cs (3)
12078Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "s => -1").WithLocation(7, 17), 12102Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "s => -1").WithLocation(5, 9), 23580Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "(a) => a").WithLocation(5, 26));