125 references to ERR_IllegalStatement
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Statements.cs (2)
654Error(diagnostics, ErrorCode.ERR_IllegalStatement, syntax); 3381Error(diagnostics, ErrorCode.ERR_IllegalStatement, syntax);
Errors\ErrorFacts.cs (1)
719case ErrorCode.ERR_IllegalStatement:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
CodeGen\CodeGenAsyncMethodBuilderOverrideTests.cs (1)
293Diagnostic(ErrorCode.ERR_IllegalStatement, "b ? await Task.Yield() : await Task.Yield()").WithLocation(21, 39)
CodeGen\CodeGenAsyncTests.cs (1)
5753Diagnostic(ErrorCode.ERR_IllegalStatement, "b ? await Task.Delay(1) : await Task.Delay(2)").WithLocation(8, 9)
CodeGen\CodeGenDeconstructTests.cs (1)
7551Diagnostic(ErrorCode.ERR_IllegalStatement, "(int x1, string x2)").WithLocation(6, 9),
CodeGen\CodeGenTupleTest.cs (2)
16208Diagnostic(ErrorCode.ERR_IllegalStatement, "(x, x)").WithLocation(6, 9) 16359Diagnostic(ErrorCode.ERR_IllegalStatement, "(1, 1)").WithLocation(6, 9)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (11)
Semantics\PatternMatchingTests.cs (1)
6182Diagnostic(ErrorCode.ERR_IllegalStatement, "z0").WithLocation(7, 31),
Semantics\PatternMatchingTests_Scope.cs (10)
1403Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(12, 23), 1418Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(17, 23), 1461Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(12, 23), 1476Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(17, 23), 2905Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(12, 29), 2917Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(18, 29), 2942Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(12, 29), 2957Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(18, 29), 3129Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(9, 29), 3135Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(11, 29),
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (8)
IOperation\IOperationTests_IDelegateCreationExpression.cs (4)
116Diagnostic(ErrorCode.ERR_IllegalStatement, "1").WithLocation(7, 36) 216Diagnostic(ErrorCode.ERR_IllegalStatement, "1").WithLocation(7, 45) 922Diagnostic(ErrorCode.ERR_IllegalStatement, "1").WithLocation(7, 47) 1382Diagnostic(ErrorCode.ERR_IllegalStatement, "1").WithLocation(7, 56)
IOperation\IOperationTests_IDynamicMemberReferenceExpression.cs (1)
288Diagnostic(ErrorCode.ERR_IllegalStatement, "d.GetValue<int, C1>").WithLocation(9, 23)
IOperation\IOperationTests_InvalidStatement.cs (2)
273Diagnostic(ErrorCode.ERR_IllegalStatement, "x").WithLocation(12, 21) 319Diagnostic(ErrorCode.ERR_IllegalStatement, "P").WithLocation(9, 24),
IOperation\IOperationTests_ITupleExpression.cs (1)
2242Diagnostic(ErrorCode.ERR_IllegalStatement, "(var ((a,b), c), int d)").WithLocation(6, 19),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (66)
Semantics\BindingAsyncTests.cs (2)
2488Diagnostic(ErrorCode.ERR_IllegalStatement, "test.Prop"), 2491Diagnostic(ErrorCode.ERR_IllegalStatement, "test[1]"),
Semantics\BindingTests.cs (2)
2887Diagnostic(ErrorCode.ERR_IllegalStatement, @"i. 2929Diagnostic(ErrorCode.ERR_IllegalStatement, @"i.
Semantics\DeconstructionTests.cs (14)
861Diagnostic(ErrorCode.ERR_IllegalStatement, "(a) => a").WithLocation(6, 9) 885Diagnostic(ErrorCode.ERR_IllegalStatement, "(a, b) => { }").WithLocation(6, 19) 4213Diagnostic(ErrorCode.ERR_IllegalStatement, "(var (a,b), var c, int d)").WithLocation(6, 9), 4357Diagnostic(ErrorCode.ERR_IllegalStatement, "(var (a,b), var c, int d)").WithLocation(2, 1) 4485Diagnostic(ErrorCode.ERR_IllegalStatement, "(var (_, _), var _, int _)").WithLocation(6, 9) 4613Diagnostic(ErrorCode.ERR_IllegalStatement, "(var (_, _), var _, int _)").WithLocation(2, 1) 5162Diagnostic(ErrorCode.ERR_IllegalStatement, "((var (a,b), var c), int d)").WithLocation(6, 9), 5315Diagnostic(ErrorCode.ERR_IllegalStatement, "((var (a,b), var c), int d)").WithLocation(2, 1) 5456Diagnostic(ErrorCode.ERR_IllegalStatement, "((var (_, _), var _), int _)").WithLocation(6, 9) 5593Diagnostic(ErrorCode.ERR_IllegalStatement, "((var (_, _), var _), int _)").WithLocation(2, 1) 5630Diagnostic(ErrorCode.ERR_IllegalStatement, "(var ((a,b), c), int d)").WithLocation(6, 9), 5749Diagnostic(ErrorCode.ERR_IllegalStatement, "(var ((a,b), c), int d)").WithLocation(2, 1) 5856Diagnostic(ErrorCode.ERR_IllegalStatement, "(var ((_, _), _), int _)").WithLocation(6, 9) 5956Diagnostic(ErrorCode.ERR_IllegalStatement, "(var ((_, _), _), int _)").WithLocation(2, 1)
Semantics\DelegateTypeTests.cs (1)
3084Diagnostic(ErrorCode.ERR_IllegalStatement, "0").WithLocation(18, 18),
Semantics\ExpressionBodiedMemberTests.cs (1)
447Diagnostic(ErrorCode.ERR_IllegalStatement, "(new object())").WithLocation(4, 25));
Semantics\ForEachTests.cs (1)
1931Diagnostic(ErrorCode.ERR_IllegalStatement, "i < 5").WithLocation(6, 18),
Semantics\ForLoopErrorTests.cs (2)
37Diagnostic(ErrorCode.ERR_IllegalStatement, "j > 5"), 199new ErrorDescription { Code = (int)ErrorCode.ERR_IllegalStatement });
Semantics\ImplicitObjectCreationTests.cs (2)
1808Diagnostic(ErrorCode.ERR_IllegalStatement, "new(a) { x }").WithLocation(6, 9), 1820Diagnostic(ErrorCode.ERR_IllegalStatement, "new() { x }").WithLocation(7, 9),
Semantics\LambdaTests.cs (5)
208Diagnostic(ErrorCode.ERR_IllegalStatement, "1").WithLocation(54, 26), 699Diagnostic(ErrorCode.ERR_IllegalStatement, "1 / 0").WithLocation(9, 32), 752Diagnostic(ErrorCode.ERR_IllegalStatement, "new D(() => { })"), 755Diagnostic(ErrorCode.ERR_IllegalStatement, "new D(()=>{})")); 1459Diagnostic(ErrorCode.ERR_IllegalStatement, "(new object())").WithLocation(6, 41));
Semantics\LocalFunctionTests.cs (1)
3903Diagnostic(ErrorCode.ERR_IllegalStatement, "2").WithLocation(13, 20),
Semantics\NameOfTests.cs (2)
645Diagnostic(ErrorCode.ERR_IllegalStatement, "nameof(N)").WithLocation(7, 9) 670Diagnostic(ErrorCode.ERR_IllegalStatement, "nameof(N)").WithLocation(7, 9)
Semantics\NullableReferenceTypesTests.cs (7)
3396Diagnostic(ErrorCode.ERR_IllegalStatement, "new object[](x)!").WithLocation(8, 43), 3429Diagnostic(ErrorCode.ERR_IllegalStatement, "x!").WithLocation(6, 9), 3435Diagnostic(ErrorCode.ERR_IllegalStatement, "M2(x)!").WithLocation(7, 9), 3441Diagnostic(ErrorCode.ERR_IllegalStatement, "x!").WithLocation(11, 9), 3447Diagnostic(ErrorCode.ERR_IllegalStatement, "M(x)!").WithLocation(12, 9) 3676Diagnostic(ErrorCode.ERR_IllegalStatement, "i.").WithLocation(7, 31) 3748Diagnostic(ErrorCode.ERR_IllegalStatement, "(throw null!)!").WithLocation(5, 9),
Semantics\NullableReferenceTypesVsPatterns.cs (3)
2777Diagnostic(ErrorCode.ERR_IllegalStatement, @"test switch { { Inner1: """" } => """" }").WithLocation(14, 9), 2816Diagnostic(ErrorCode.ERR_IllegalStatement, @"test switch { { Next.Inner1: """" } => """" }").WithLocation(16, 9), 2853Diagnostic(ErrorCode.ERR_IllegalStatement, @"test switch { { Method: """" } => """" }").WithLocation(14, 9),
Semantics\OutVarTests.cs (4)
9046Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(12, 23), 9061Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(17, 23), 9104Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(12, 23), 9119Diagnostic(ErrorCode.ERR_IllegalStatement, "let").WithLocation(17, 23),
Semantics\RefFieldTests.cs (2)
21523Diagnostic(ErrorCode.ERR_IllegalStatement, "local").WithLocation(5, 22) 21553Diagnostic(ErrorCode.ERR_IllegalStatement, "local").WithLocation(5, 29)
Semantics\ScriptSemanticsTests.cs (1)
1077Diagnostic(ErrorCode.ERR_IllegalStatement, "i* i"));
Semantics\SemanticAnalyzerTests.cs (1)
167Diagnostic(ErrorCode.ERR_IllegalStatement, "x").WithLocation(6, 9));
Semantics\SemanticErrorTests.cs (12)
7838Diagnostic(ErrorCode.ERR_IllegalStatement, "checked(i++)")); 7858Diagnostic(ErrorCode.ERR_IllegalStatement, "(a) => a").WithLocation(6, 9), 7861Diagnostic(ErrorCode.ERR_IllegalStatement, "(a, b) => { }").WithLocation(7, 9), 7864Diagnostic(ErrorCode.ERR_IllegalStatement, "x + y").WithLocation(9, 9), 7867Diagnostic(ErrorCode.ERR_IllegalStatement, "x == 1").WithLocation(9, 16), 7892Diagnostic(ErrorCode.ERR_IllegalStatement, "(a) => a").WithLocation(6, 9), 7895Diagnostic(ErrorCode.ERR_IllegalStatement, "(a, b) => { }").WithLocation(7, 9), 7898Diagnostic(ErrorCode.ERR_IllegalStatement, "x + y").WithLocation(9, 9), 7901Diagnostic(ErrorCode.ERR_IllegalStatement, "x == 1").WithLocation(9, 16), 24413Diagnostic(ErrorCode.ERR_IllegalStatement, "x?.Length").WithLocation(8, 9), 24416Diagnostic(ErrorCode.ERR_IllegalStatement, "x?[1]").WithLocation(9, 9), 24419Diagnostic(ErrorCode.ERR_IllegalStatement, "x?.ToString()[1]").WithLocation(10, 9)
Semantics\StackAllocInitializerTests.cs (3)
868Diagnostic(ErrorCode.ERR_IllegalStatement, "stackalloc[] {1}").WithLocation(6, 9), 871Diagnostic(ErrorCode.ERR_IllegalStatement, "stackalloc int[] {1}").WithLocation(7, 9), 874Diagnostic(ErrorCode.ERR_IllegalStatement, "stackalloc int[1] {1}").WithLocation(8, 9)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (32)
Parsing\FileModifierParsingTests.cs (2)
2142Diagnostic(ErrorCode.ERR_IllegalStatement, "file").WithLocation(1, 1) 2176Diagnostic(ErrorCode.ERR_IllegalStatement, "file").WithLocation(1, 1)
Parsing\ParserErrorMessageTests.cs (3)
714Diagnostic(ErrorCode.ERR_IllegalStatement, "m").WithLocation(8, 20), 738Diagnostic(ErrorCode.ERR_IllegalStatement, "e").WithLocation(11, 16), 4844Diagnostic(ErrorCode.ERR_IllegalStatement, "30").WithLocation(7, 34)
Parsing\RawInterpolatedStringLiteralCompilingTests.cs (1)
456Diagnostic(ErrorCode.ERR_IllegalStatement, @"$"""""" """"""").WithLocation(6, 9));
Parsing\RawStringLiteralCompilingTests.cs (1)
381Diagnostic(ErrorCode.ERR_IllegalStatement, @""""""" """"""").WithLocation(6, 9));
Parsing\StatementAttributeParsingTests.cs (25)
3497Diagnostic(ErrorCode.ERR_IllegalStatement, "delegate () { }").WithLocation(6, 12)); 3579Diagnostic(ErrorCode.ERR_IllegalStatement, "() => { }").WithLocation(6, 12)); 3669Diagnostic(ErrorCode.ERR_IllegalStatement, "(int i) => { }").WithLocation(6, 12)); 3750Diagnostic(ErrorCode.ERR_IllegalStatement, "i => { }").WithLocation(6, 12)); 3824Diagnostic(ErrorCode.ERR_IllegalStatement, "new { }").WithLocation(6, 12)); 3917Diagnostic(ErrorCode.ERR_IllegalStatement, "new int[] { }").WithLocation(6, 12)); 4000Diagnostic(ErrorCode.ERR_IllegalStatement, "new [] { 0 }").WithLocation(6, 12)); 4417Diagnostic(ErrorCode.ERR_IllegalStatement, "a + a").WithLocation(6, 12)); 4506Diagnostic(ErrorCode.ERR_IllegalStatement, "(object)a").WithLocation(6, 12)); 4681Diagnostic(ErrorCode.ERR_IllegalStatement, "default(int)").WithLocation(6, 12)); 4756Diagnostic(ErrorCode.ERR_IllegalStatement, "default").WithLocation(6, 12)); 4851Diagnostic(ErrorCode.ERR_IllegalStatement, "s[0]").WithLocation(6, 12)); 4950Diagnostic(ErrorCode.ERR_IllegalStatement, "s?[0]").WithLocation(6, 12)); 5099Diagnostic(ErrorCode.ERR_IllegalStatement, "0").WithLocation(6, 12)); 5187Diagnostic(ErrorCode.ERR_IllegalStatement, "i.ToString").WithLocation(6, 12)); 5428Diagnostic(ErrorCode.ERR_IllegalStatement, "(1)").WithLocation(6, 12)); 5708Diagnostic(ErrorCode.ERR_IllegalStatement, "from c in s select c").WithLocation(7, 12)); 5811Diagnostic(ErrorCode.ERR_IllegalStatement, "a..b").WithLocation(6, 12), 5913Diagnostic(ErrorCode.ERR_IllegalStatement, "a..").WithLocation(6, 12)); 6009Diagnostic(ErrorCode.ERR_IllegalStatement, "..b").WithLocation(6, 12), 6104Diagnostic(ErrorCode.ERR_IllegalStatement, "..").WithLocation(6, 12)); 6182Diagnostic(ErrorCode.ERR_IllegalStatement, "sizeof(int)").WithLocation(6, 12)); 6268Diagnostic(ErrorCode.ERR_IllegalStatement, "a switch { }").WithLocation(6, 12), 6352Diagnostic(ErrorCode.ERR_IllegalStatement, "typeof(int)").WithLocation(6, 12)); 6762Diagnostic(ErrorCode.ERR_IllegalStatement, "0").WithLocation(6, 31));