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