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