18 references to ERR_CantConvAnonMethReturnType
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Statements.cs (1)
2043
Error(diagnostics, ErrorCode.
ERR_CantConvAnonMethReturnType
, syntax, id, targetType);
Errors\ErrorFacts.cs (1)
2132
case ErrorCode.
ERR_CantConvAnonMethReturnType
:
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (16)
Semantics\DelegateTypeTests.cs (2)
6122
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "string () => default").WithArguments("lambda expression", "System.Func<object>").WithLocation(8, 18));
7441
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "string () => string.Empty").WithArguments("lambda expression", "System.Func<object>").WithLocation(7, 27));
Semantics\LambdaTests.cs (14)
5042
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "T () => default").WithArguments("lambda expression", "System.Func<U>").WithLocation(9, 14),
5045
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "U () => default").WithArguments("lambda expression", "System.Func<T>").WithLocation(10, 14));
5069
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "T () => default").WithArguments("lambda expression", "System.Func<U>").WithLocation(9, 14),
5072
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "U () => default").WithArguments("lambda expression", "System.Func<T>").WithLocation(10, 14));
5097
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "T () => default").WithArguments("lambda expression", "System.Linq.Expressions.Expression<System.Func<U>>").WithLocation(10, 14),
5100
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "U () => default").WithArguments("lambda expression", "System.Linq.Expressions.Expression<System.Func<T>>").WithLocation(11, 14));
5286
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "T (ref T t) => t").WithArguments("lambda expression", "D2<T>").WithLocation(12, 14),
5289
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "T (ref T t) => t").WithArguments("lambda expression", "D3<T>").WithLocation(13, 14),
5292
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "ref T (ref T t) => ref t").WithArguments("lambda expression", "D1<T>").WithLocation(14, 15),
5295
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "ref T (ref T t) => ref t").WithArguments("lambda expression", "D3<T>").WithLocation(16, 15),
5298
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "ref readonly T (ref T t) => ref t").WithArguments("lambda expression", "D1<T>").WithLocation(17, 15),
5301
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "ref readonly T (ref T t) => ref t").WithArguments("lambda expression", "D2<T>").WithLocation(18, 15));
6884
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "static partial () => { }").WithArguments("lambda expression", "System.Action").WithLocation(5, 27),
6942
Diagnostic(ErrorCode.
ERR_CantConvAnonMethReturnType
, "partial () => { }").WithArguments("lambda expression", "System.Action").WithLocation(5, 27));