45 references to ERR_TopLevelStatementAfterNamespaceOrType
Microsoft.CodeAnalysis.CSharp (2)
Errors\ErrorFacts.cs (1)
2076or ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType
Parser\LanguageParser.cs (1)
783memberOrStatement = this.AddError(memberOrStatement, ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\PrimaryConstructorTests.cs (1)
3317Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "();").WithLocation(9, 7),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (18)
Semantics\NullableContextTests.cs (2)
1690Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "if (x == null) { }").WithLocation(7, 1)); 1706Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "if (x == null) { }").WithLocation(8, 1));
Semantics\RecordStructTests.cs (1)
746Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "System.Console.WriteLine();").WithLocation(3, 1)
Semantics\RefFieldTests.cs (2)
11825Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "readonly scoped record ").WithLocation(3, 1), 11871Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "readonly scoped record ").WithLocation(3, 1),
Semantics\SemanticErrorTests.cs (2)
2796Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "D d = null;").WithLocation(3, 1), 2816Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "D d = {;").WithLocation(3, 1),
Semantics\TopLevelStatementsTests.cs (11)
5704Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "System.Console.WriteLine(1);").WithLocation(4, 1) 5725Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "System.Console.WriteLine(1);").WithLocation(6, 1) 5749Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "System.Console.WriteLine(1);").WithLocation(4, 1) 5775Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "System.Console.WriteLine(1);").WithLocation(6, 1) 5796Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "System.Console.WriteLine(1);").WithLocation(6, 1) 5817Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "System.Console.WriteLine(1);").WithLocation(6, 1) 5838Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "System.Console.WriteLine(1);").WithLocation(6, 1) 5859Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "System.Console.WriteLine(1);").WithLocation(6, 1) 5968Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "void local() => System.Console.WriteLine(1);").WithLocation(6, 1) 9659Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "var x = 1;").WithLocation(6, 1), 9739Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "").WithLocation(2, 1),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Symbols\Source\RecordTests.cs (1)
1224Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "data ").WithLocation(3, 1),
Symbols\SymbolErrorTests.cs (2)
21571Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "{ }").WithLocation(3, 14), 21598Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "{ }").WithLocation(3, 14),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (21)
Parsing\DeclarationParsingTests.cs (4)
8275Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "Del d = delegate(int k!!) { /* ... */ };").WithLocation(3, 1), 8544Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, @"C 8580Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, @"C 9476Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, ";").WithLocation(3, 1)
Parsing\DeclarationScopeParsingTests.cs (1)
11206Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "readonly scoped record ").WithLocation(3, 1),
Parsing\ParserErrorMessageTests.cs (3)
60Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, @"public static int Main() 653Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "{ }").WithLocation(2, 20), 3836Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, @"D
Parsing\ParsingErrorRecoveryTests.cs (1)
60Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, """
Parsing\RecordParsing.cs (3)
1244Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "int x = with { ").WithLocation(6, 5), 3125Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "C(int X, int Y);").WithLocation(1, 15), 3457Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "C(int X, int Y);").WithLocation(1, 18),
Parsing\RefReadonlyTests.cs (1)
151Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, @"static async ref readonly Task M<T>()
Parsing\TopLevelStatementsParsingTests.cs (8)
131Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "[a]fod;").WithLocation(15, 1), 608Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "4").WithLocation(1, 10), 666Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, @"public static int Main() 800Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, @"D 989Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "{ }").WithLocation(2, 20), 1009Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "{ }").WithLocation(2, 20) 1237Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "static int Main() { return 1; }").WithLocation(5, 2), 3564Diagnostic(ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType, "").WithLocation(2, 1),