67 references to ERR_ReturnExpected
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Statements.cs (1)
630blockDiagnostics.Add(ErrorCode.ERR_ReturnExpected, localSymbol.GetFirstLocation(), localSymbol);
Errors\ErrorFacts.cs (1)
747or ErrorCode.ERR_ReturnExpected
FlowAnalysis\FlowAnalysisPass.cs (1)
103diagnostics.Add(ErrorCode.ERR_ReturnExpected, method.GetFirstLocation(), method);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (7)
CodeGen\CodeGenAsyncIteratorTests.cs (5)
2173Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("C.M()").WithLocation(4, 74) 2286Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("C.M()").WithLocation(4, 74) 2326Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("C.M(int)").WithLocation(4, 67) 6389Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("C.M()").WithLocation(4, 60) 6465Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("C.M()").WithLocation(4, 60)
CodeGen\CodeGenAsyncMainTests.cs (2)
471Diagnostic(ErrorCode.ERR_ReturnExpected, "Main").WithArguments("Program.Main()").WithLocation(6, 28)); 548Diagnostic(ErrorCode.ERR_ReturnExpected, "Main").WithArguments("Program.Main(string[])").WithLocation(6, 28));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (7)
FlowAnalysis\FlowTests.cs (2)
165Diagnostic(ErrorCode.ERR_ReturnExpected, "M5").WithArguments("C.M5()").WithLocation(46, 26), 176Diagnostic(ErrorCode.ERR_ReturnExpected, "M5").WithArguments("C.M5()").WithLocation(46, 26),
PartialEventsAndConstructorsTests.cs (5)
152Diagnostic(ErrorCode.ERR_ReturnExpected, "F").WithArguments("C.F()").WithLocation(3, 13), 164Diagnostic(ErrorCode.ERR_ReturnExpected, "C").WithArguments("C.C()").WithLocation(4, 13)); 185Diagnostic(ErrorCode.ERR_ReturnExpected, "F").WithArguments("C.F()").WithLocation(3, 14), 194Diagnostic(ErrorCode.ERR_ReturnExpected, "C").WithArguments("C.C()").WithLocation(4, 14) 245Diagnostic(ErrorCode.ERR_ReturnExpected, "C").WithArguments("C.C()").WithLocation(6, 13));
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_ILocalFunctionStatement.cs (1)
459Diagnostic(ErrorCode.ERR_ReturnExpected, "F").WithArguments("F()").WithLocation(6, 21),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (27)
Semantics\BindingAsyncTasklikeTests.cs (2)
334Diagnostic(ErrorCode.ERR_ReturnExpected, "f").WithArguments("C.f()").WithLocation(6, 18) 352Diagnostic(ErrorCode.ERR_ReturnExpected, "f").WithArguments("C.f()").WithLocation(6, 18)
Semantics\BindingAsyncTests.cs (5)
301Diagnostic(ErrorCode.ERR_ReturnExpected, "F1").WithArguments("C.F1()"), 304Diagnostic(ErrorCode.ERR_ReturnExpected, "F2").WithArguments("C.F2()"), 307Diagnostic(ErrorCode.ERR_ReturnExpected, "F3").WithArguments("C.F3<T>()"), 310Diagnostic(ErrorCode.ERR_ReturnExpected, "F4").WithArguments("C.F4<T>()")); 1271Diagnostic(ErrorCode.ERR_ReturnExpected, "M2").WithArguments("Test.M2()").WithLocation(6, 17));
Semantics\BindingTests.cs (2)
755Diagnostic(ErrorCode.ERR_ReturnExpected, "Main").WithArguments("Test.Main(string[])") 2885Diagnostic(ErrorCode.ERR_ReturnExpected, "LazyToString").WithArguments("LazyToStringExtension.LazyToString<T>(T)").WithLocation(7, 26));
Semantics\ImplicitObjectCreationTests.cs (1)
4963Diagnostic(ErrorCode.ERR_ReturnExpected, "Something").WithArguments("SomeNamespace.Class1.Something<T>()").WithLocation(4, 12),
Semantics\LocalFunctionTests.cs (2)
4362Diagnostic(ErrorCode.ERR_ReturnExpected, "TakeOutParam1").WithArguments("TakeOutParam1(out int)").WithLocation(6, 13), 4371Diagnostic(ErrorCode.ERR_ReturnExpected, "TakeOutParam2").WithArguments("C.TakeOutParam2(out int)").WithLocation(14, 13)
Semantics\NullableReferenceTypesTests.cs (2)
22221Diagnostic(ErrorCode.ERR_ReturnExpected, "init").WithArguments("init()").WithLocation(14, 13), 28880Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("C.M(out object?)").WithLocation(6, 25),
Semantics\NullableReferenceTypesVsPatterns.cs (3)
2771Diagnostic(ErrorCode.ERR_ReturnExpected, "Test").WithArguments("Class2.Test()").WithLocation(11, 17), 2810Diagnostic(ErrorCode.ERR_ReturnExpected, "Test").WithArguments("Class2.Test()").WithLocation(13, 17), 2847Diagnostic(ErrorCode.ERR_ReturnExpected, "Test").WithArguments("Class2.Test()").WithLocation(11, 17),
Semantics\RefEscapingTests.cs (1)
4560Diagnostic(ErrorCode.ERR_ReturnExpected, "Test1").WithArguments("Program.Test1()").WithLocation(12, 13)
Semantics\SemanticAnalyzerTests.cs (1)
687Diagnostic(ErrorCode.ERR_ReturnExpected, "GetS").WithArguments("C.GetS(N.Q<string, double>?[][*,*][*,*,*], int?)").WithLocation(7, 7),
Semantics\SemanticErrorTests.cs (5)
6078new ErrorDescription[] { new ErrorDescription { Code = (int)ErrorCode.ERR_ReturnExpected, Line = 4, Column = 22 } }); 7874Diagnostic(ErrorCode.ERR_ReturnExpected, "Main").WithArguments("A.Main()").WithLocation(4, 23) 7908Diagnostic(ErrorCode.ERR_ReturnExpected, "Main").WithArguments("A.Main()").WithLocation(4, 23) 15197Diagnostic(ErrorCode.ERR_ReturnExpected, "GetEnumerator").WithArguments("C.GetEnumerator()") 24752Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("Program.M(object, object)").WithLocation(4, 19));
Semantics\SwitchTests.cs (2)
2717Diagnostic(ErrorCode.ERR_ReturnExpected, "Main").WithArguments("SwitchTest.Main(string[])").WithLocation(4, 16) 2722Diagnostic(ErrorCode.ERR_ReturnExpected, "Main").WithArguments("SwitchTest.Main(string[])").WithLocation(4, 16)
Semantics\TopLevelStatementsTests.cs (1)
1546Diagnostic(ErrorCode.ERR_ReturnExpected, @"System.Console.WriteLine();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (7)
Symbols\ExtendedPartialMethodsTests.cs (1)
1394Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("C.M()").WithLocation(7, 27),
Symbols\Source\ExpressionBodiedMethodTests.cs (1)
81Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("C.M()").WithLocation(4, 16));
Symbols\Source\MethodTests.cs (2)
2275Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("C.M()").WithLocation(4, 26) 2299Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("C.M()").WithLocation(4, 35)
Symbols\SymbolErrorTests.cs (2)
1151Diagnostic(ErrorCode.ERR_ReturnExpected, "F").WithArguments("NS.C.F<>(int, (?, ?))").WithLocation(5, 9) 1205Diagnostic(ErrorCode.ERR_ReturnExpected, "F").WithArguments("NS.C.F<>(int, (?, ?))").WithLocation(5, 9)
Symbols\UserDefinedOperatorErrorTests.cs (1)
165Diagnostic(ErrorCode.ERR_ReturnExpected, "int").WithArguments("C.explicit operator int(C)")
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (15)
Parsing\DeconstructionTests.cs (1)
2401Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("C.M(string)").WithLocation(4, 17));
Parsing\FileModifierParsingTests.cs (3)
2622Diagnostic(ErrorCode.ERR_ReturnExpected, "record").WithArguments("C.record()").WithLocation(3, 10) 2818Diagnostic(ErrorCode.ERR_ReturnExpected, "X").WithArguments("C.X()").WithLocation(3, 17) 3429Diagnostic(ErrorCode.ERR_ReturnExpected, "local").WithArguments("local()").WithLocation(1, 6),
Parsing\LocalFunctionParsingTests.cs (4)
1217Diagnostic(ErrorCode.ERR_ReturnExpected, "goo").WithArguments("goo<T>()").WithLocation(11, 13), 2495Diagnostic(ErrorCode.ERR_ReturnExpected, "").WithArguments("()").WithLocation(5, 22)); 2514Diagnostic(ErrorCode.ERR_ReturnExpected, "").WithArguments("()").WithLocation(5, 22)); 2533Diagnostic(ErrorCode.ERR_ReturnExpected, "").WithArguments("()").WithLocation(5, 22));
Parsing\MemberDeclarationParsingTests.cs (1)
1632Diagnostic(ErrorCode.ERR_ReturnExpected, "C").WithArguments("C.implicit operator C(S)").WithLocation(1, 45),
Parsing\ParserErrorMessageTests.cs (5)
5479Diagnostic(ErrorCode.ERR_ReturnExpected, "Goo").WithArguments("C.Goo()").WithLocation(4, 17)); 5495Diagnostic(ErrorCode.ERR_ReturnExpected, "Goo").WithArguments("C.Goo()").WithLocation(4, 17)); 5679Diagnostic(ErrorCode.ERR_ReturnExpected, "Main").WithArguments("C.Main()").WithLocation(4, 23), 5686Diagnostic(ErrorCode.ERR_ReturnExpected, "Main").WithArguments("C.Main()").WithLocation(4, 23), 5858Diagnostic(ErrorCode.ERR_ReturnExpected, "Main").WithArguments("MyClass.Main(bool)").WithLocation(4, 23));
Parsing\UsingDirectiveParsingTests.cs (1)
2479Diagnostic(ErrorCode.ERR_ReturnExpected, "M").WithArguments("C.M()").WithLocation(5, 7));