90 references to ERR_BadEmbeddedStmt
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Statements.cs (2)
327
diagnostics.Add(ErrorCode.
ERR_BadEmbeddedStmt
, node.GetLocation());
345
diagnostics.Add(ErrorCode.
ERR_BadEmbeddedStmt
, node.GetLocation());
Errors\ErrorFacts.cs (1)
1158
or ErrorCode.
ERR_BadEmbeddedStmt
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (7)
CodeGen\CodeGenUsingDeclarationTests.cs (7)
1480
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "const var obj2 = new object()) ").WithLocation(1, 8),
1530
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "const var obj = new object()) ").WithLocation(1, 14),
1588
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "const System.IDisposable obj) ").WithLocation(1, 8),
1641
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "const System.IAsyncDisposable obj) ").WithLocation(1, 14),
1705
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "readonly var obj2 = new object()) ").WithLocation(1, 8),
1763
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "static var obj2 = new object()) ").WithLocation(1, 8),
1821
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "volatile var obj2 = new object()) ").WithLocation(1, 8),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (59)
Semantics\OutVarTests.cs (28)
3810
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(97, 13),
5879
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
6294
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(109, 13),
6532
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(109, 13),
6767
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(109, 13),
7031
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(109, 13),
7269
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(109, 13),
8354
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
8626
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(101, 13),
9687
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var d =TakeOutParam(true, out var x1) && x1 != null;").WithLocation(11, 13),
10690
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
15500
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
15713
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
15926
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
16369
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
17365
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "a: Dummy(TakeOutParam(true, out var x9), x9);").WithLocation(65, 1),
17371
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "a: Dummy(TakeOutParam(true, out var x10), x10);").WithLocation(73, 1),
17479
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "a: Dummy(TakeOutParam(true, out var x1));").WithLocation(13, 1),
21351
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var d,e(TakeOutParam(true, out var x1) && x1 != null);").WithLocation(11, 13),
21633
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(109, 13),
21981
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
22394
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
23639
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(74, 5),
23737
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(74, 5),
23977
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(52, 5),
24081
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(52, 5),
25262
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(52, 5),
25379
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(52, 5),
Semantics\PatternMatchingTests.cs (1)
4876
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "int _ ").WithLocation(6, 37),
Semantics\PatternMatchingTests_Global.cs (6)
6910
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(74, 5),
7008
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(74, 5),
7227
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(52, 5),
7331
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(52, 5),
8452
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(52, 5),
8569
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(52, 5),
Semantics\PatternMatchingTests_Scope.cs (24)
1122
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(110, 13),
5469
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
5676
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
5883
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
6511
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var d = true is var x1;").WithLocation(11, 13),
7054
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
7352
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(97, 13),
7688
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(109, 13),
7920
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(109, 13),
8149
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(109, 13),
8407
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(109, 13),
8639
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(109, 13),
9270
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
9482
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
9768
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
10565
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "a: Dummy(true is var x9, x9);").WithLocation(65, 1),
10571
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "a: Dummy(true is var x10, x10);").WithLocation(73, 1),
10673
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "a: Dummy(true is var x1);").WithLocation(13, 1),
12192
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var d,e(string.Empty is var x1 && x1 != null);").WithLocation(11, 13),
12463
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(109, 13),
12802
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
13197
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "var y12 = 12;").WithLocation(87, 13),
13978
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "int[true is var x7, x7] _11;").WithLocation(49, 13),
13984
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "int[true is var x8, x8] _12;").WithLocation(57, 25),
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (6)
IOperation\IOperationTests_IIsPatternExpression.cs (1)
500
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "const int y) ").WithLocation(8, 39),
IOperation\IOperationTests_IUsingStatement.cs (5)
6816
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, @"label1:
6820
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, @"label2:
9004
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "using C1 o1 = new C1();").WithLocation(12, 13)
9101
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "using C1 o1 = new C1();").WithLocation(13, 13)
9197
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "using C1 o1 = new C1();").WithLocation(13, 13)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (12)
Semantics\BindingTests.cs (2)
2041
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "object o = null;").WithLocation(7, 32),
2068
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "label: c = false;").WithLocation(9, 13),
Semantics\ConstantTests.cs (2)
3289
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "const int i = 0;").WithLocation(6, 26),
3371
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "const int i = 0;").WithLocation(2, 18),
Semantics\LocalFunctionTests.cs (2)
4040
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "int Add(int x, int y) => x + y;").WithLocation(7, 9),
4066
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "a: int Add(int x, int y) => x + y;").WithLocation(7, 1),
Semantics\LockTests.cs (2)
467
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, @"object)
736
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "object o = new object();"));
Semantics\RefLocalsAndReturnsTests.cs (2)
1449
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "ref int x = ref (new int[1])[0];").WithLocation(8, 13));
1470
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "ref int x = ref (new int[1])[0];").WithLocation(8, 13));
Semantics\SemanticErrorTests.cs (1)
24746
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "value: new Program();").WithLocation(6, 41),
Semantics\UsingStatementTests.cs (1)
1720
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "object o = new object();"));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (3)
Parsing\ParserErrorMessageTests.cs (3)
2459
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "MyLabel: {}").WithLocation(6, 35),
2481
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "int j;").WithLocation(6, 35),
2503
Diagnostic(ErrorCode.
ERR_BadEmbeddedStmt
, "void j() { }").WithLocation(6, 35),