293 references to ERR_VariableUsedBeforeDeclaration
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Expressions.cs (1)
2067
Error(diagnostics, ErrorCode.
ERR_VariableUsedBeforeDeclaration
, node, node);
Errors\ErrorFacts.cs (1)
1127
or ErrorCode.
ERR_VariableUsedBeforeDeclaration
Symbols\LocalSymbol.cs (1)
383
internal virtual ErrorCode ForbiddenDiagnostic => ErrorCode.
ERR_VariableUsedBeforeDeclaration
;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (14)
CodeGen\CodeGenDeconstructTests.cs (13)
6753
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x").WithLocation(6, 17),
6759
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y").WithArguments("y").WithLocation(7, 10)
6766
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x").WithLocation(6, 17),
6769
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y").WithArguments("y").WithLocation(7, 10)
6840
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x").WithLocation(6, 10)
10118
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1", isSuppressed: false).WithArguments("x1").WithLocation(6, 10),
10121
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y2", isSuppressed: false).WithArguments("y2").WithLocation(8, 18),
10124
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "z3", isSuppressed: false).WithArguments("z3").WithLocation(10, 30),
10127
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4", isSuppressed: false).WithArguments("x4").WithLocation(12, 10));
10167
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(6, 18),
10170
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(7, 10),
10173
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x3").WithArguments("x3").WithLocation(8, 27),
10176
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(9, 10));
CodeGen\CodeGenTupleEqualityTests.cs (1)
2921
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "z").WithArguments("z").WithLocation(7, 14)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (208)
FlowAnalysis\LocalFunctions.cs (2)
150
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x").WithLocation(9, 21));
169
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x").WithLocation(7, 20));
Semantics\OutVarTests.cs (103)
1825
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(6, 15)
1857
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(6, 19)
1921
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(6, 19)
1975
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(9, 15),
2085
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(9, 11),
2196
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(9, 15),
2306
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(9, 11),
2616
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(34, 21),
2833
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(34, 21),
3186
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(13, 16),
3288
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(13, 16),
3813
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(14, 19),
3816
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(22, 19),
3822
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(32, 19),
3825
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(40, 16),
3828
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(39, 19),
3834
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x8").WithArguments("x8").WithLocation(56, 19),
3840
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(66, 19),
3846
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(68, 23),
3861
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x14").WithArguments("x14").WithLocation(112, 19)
4258
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 29),
4462
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(18, 30),
4478
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(18, 30),
4660
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 19),
4895
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(21, 15),
4913
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(79, 15)
5162
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 18),
5257
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(6, 13),
5384
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 24),
5885
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 31),
6300
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
6538
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
6779
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
7037
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
7275
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
7516
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(13, 54),
7561
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(77, 23),
7591
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x12").WithArguments("x12").WithLocation(105, 20),
7621
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x15").WithArguments("x15").WithLocation(133, 20)
7767
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(13, 20),
8360
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 33),
8638
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(58, 13),
8644
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(83, 19),
9070
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(27, 49),
9088
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x12").WithArguments("x12").WithLocation(82, 15)
9128
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(27, 49),
9158
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x12").WithArguments("x12").WithLocation(82, 15)
9328
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 23),
9421
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 26),
9498
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(13, 56),
9580
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(31, 27)
9884
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 24),
9979
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 34),
10058
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(13, 56),
10145
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(31, 41)
10696
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 21),
10702
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(60, 19),
11020
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(11, 25),
11157
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(11, 25),
11253
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 25),
13174
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(21, 22),
13195
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(79, 15),
13587
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(47, 17),
13593
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(71, 23),
14076
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(30, 31),
14091
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(112, 31),
15095
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(21, 21),
15116
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(79, 15),
15506
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 22),
15719
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 30),
15932
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 45),
16062
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(12, 63),
16155
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(39, 46)
16375
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 16),
16938
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(23, 28),
16956
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(72, 15)
17332
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(21, 15),
17377
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(79, 15),
20908
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 23),
21128
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(31, 27)
21232
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(31, 27)
21597
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
21779
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(12, 22),
21987
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 30),
22233
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(39, 46)
22400
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 31),
22769
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 18),
23188
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(20, 13),
23276
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(20, 13),
23642
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(25, 15),
23740
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(25, 15),
23980
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(18, 25),
24084
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(18, 25),
24276
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(6, 41),
24367
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(6, 41),
24391
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x12").WithArguments("x12").WithLocation(37, 9),
25265
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(18, 14),
25361
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(18, 14),
26074
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x5").WithArguments("x5").WithLocation(16, 29),
33767
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(8, 23),
33865
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(8, 19),
33964
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(8, 23),
34062
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(8, 19),
Semantics\PatternMatchingTests.cs (1)
4867
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "NotFound").WithArguments("NotFound").WithLocation(6, 13),
Semantics\PatternMatchingTests_Global.cs (12)
565
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x5").WithArguments("x5").WithLocation(16, 29),
6491
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(20, 13),
6579
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(20, 13),
6913
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(25, 15),
7011
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(25, 15),
7230
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(18, 25),
7334
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(18, 25),
7508
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(6, 39),
7599
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(6, 39),
7617
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x12").WithArguments("x12").WithLocation(37, 9)
8455
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(18, 14),
8551
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(18, 14),
Semantics\PatternMatchingTests_Scope.cs (90)
181
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(21, 15),
199
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(79, 15)
560
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(21, 22),
581
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(79, 15),
830
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(21, 21),
851
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(79, 15),
1134
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(58, 13),
1140
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(83, 19),
1427
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(27, 49),
1445
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x12").WithArguments("x12").WithLocation(82, 15)
1485
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(27, 49),
1515
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x12").WithArguments("x12").WithLocation(82, 15)
2923
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(30, 30),
2966
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(30, 30),
3138
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(15, 29),
3253
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(15, 19),
3339
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 18),
3424
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(6, 13),
3511
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 24),
3596
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 25),
3684
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(11, 25),
3775
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(9, 15),
3865
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(9, 11),
3963
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(13, 16),
4059
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(13, 16),
4451
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(30, 31),
4466
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(112, 31),
4836
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(30, 31),
4854
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(116, 31),
5178
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(47, 17),
5184
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(71, 23),
5193
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y10").WithArguments("y10").WithLocation(87, 25),
5196
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y10").WithArguments("y10").WithLocation(89, 18),
5205
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y15").WithArguments("y15").WithLocation(125, 25),
5208
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y15").WithArguments("y15").WithLocation(127, 18)
5475
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 22),
5682
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 30),
5889
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 45),
6013
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(12, 47),
6100
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(39, 46)
6180
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 23),
6267
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 26),
6338
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(13, 40),
6414
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(31, 27)
6581
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 24),
6670
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 34),
6743
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(13, 42),
6824
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(31, 41)
7060
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 16),
7355
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(14, 19),
7358
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(22, 19),
7364
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(32, 19),
7367
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(40, 16),
7370
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(39, 19),
7376
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x8").WithArguments("x8").WithLocation(56, 19),
7382
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(66, 19),
7388
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(68, 23),
7403
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x14").WithArguments("x14").WithLocation(112, 19)
7694
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
7926
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
8161
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
8413
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
8645
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
8880
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(13, 38),
8925
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(77, 23),
8955
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x12").WithArguments("x12").WithLocation(105, 20),
8985
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x15").WithArguments("x15").WithLocation(133, 20)
9125
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(13, 20),
9276
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 33),
9488
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 21),
9494
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(60, 19),
9774
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 31),
10054
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(23, 28),
10072
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(72, 15)
10344
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(34, 21),
10535
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(21, 15),
10577
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(79, 15),
10948
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(32, 31),
10963
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(114, 31),
11795
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 23),
11987
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(31, 27)
12085
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(31, 27)
12427
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
12603
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(12, 22),
12808
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 30),
13042
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(39, 46)
13203
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 31),
13520
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 18),
13939
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(19, 13),
13993
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(63, 13),
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_IUsingStatement.cs (1)
8747
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "local").WithArguments("local").WithLocation(8, 13)
IOperation\IOperationTests_IVariableDeclaration.cs (1)
4077
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "a").WithArguments("a").WithLocation(7, 9)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (65)
Semantics\ColorColorTests.cs (2)
1968
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "E").WithArguments("E").WithLocation(11, 23)
2070
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "E").WithArguments("E").WithLocation(11, 17)
Semantics\ConstantTests.cs (3)
4098
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x").WithLocation(1, 15));
4156
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y").WithArguments("y").WithLocation(1, 23));
4169
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y").WithArguments("y").WithLocation(1, 15),
Semantics\DeconstructionTests.cs (9)
2476
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(6, 34)
3023
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(6, 38)
3064
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(6, 35)
3386
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(6, 43)
3427
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(6, 40)
3795
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(6, 31),
3798
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(6, 42)
6288
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "i").WithArguments("i").WithLocation(6, 26),
6323
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "i").WithArguments("i").WithLocation(6, 17),
Semantics\ImplicitlyTypedLocalsTests.cs (3)
76
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x").WithLocation(6, 23),
79
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y").WithArguments("y").WithLocation(6, 17),
82
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y").WithArguments("y").WithLocation(7, 23)
Semantics\IndexAndRangeTests.cs (1)
1557
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y").WithArguments("y").WithLocation(7, 22));
Semantics\LambdaTests.cs (5)
7787
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "s").WithArguments("s").WithLocation(5, 33));
7811
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "lam").WithArguments("lam").WithLocation(7, 33));
7835
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "lam").WithArguments("lam").WithLocation(7, 40));
7859
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "lam").WithArguments("lam").WithLocation(7, 33),
8200
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "lam").WithArguments("lam").WithLocation(6, 31));
Semantics\NameCollisionTests.cs (6)
763
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "name4").WithArguments("name4").WithLocation(7, 9),
778
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "name5").WithArguments("name5").WithLocation(18, 43),
1108
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "name2").WithArguments("name2").WithLocation(18, 13),
1123
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "name2").WithArguments("name2").WithLocation(44, 31));
1128
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "name2").WithArguments("name2").WithLocation(18, 13),
1137
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "name2").WithArguments("name2").WithLocation(44, 31));
Semantics\NameOfTests.cs (1)
287
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "b").WithArguments("b").WithLocation(33, 20),
Semantics\NullableReferenceTypesTests.cs (6)
55752
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x").WithLocation(5, 29),
59145
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "t").WithArguments("t").WithLocation(5, 9),
59365
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "s").WithArguments("s").WithLocation(5, 17));
81327
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "a").WithArguments("a").WithLocation(11, 27));
81371
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "b").WithArguments("b").WithLocation(11, 27));
161130
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "lam").WithArguments("lam").WithLocation(7, 30));
Semantics\ScriptSemanticsTests.cs (3)
957
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x").WithLocation(1, 22)
980
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "e").WithArguments("e").WithLocation(9, 16),
983
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "c").WithArguments("c").WithLocation(5, 16));
Semantics\SemanticErrorTests.cs (5)
12854
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "j").WithArguments("j"),
12874
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "b").WithArguments("b"),
12875
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y").WithArguments("y"));
12896
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x"));
12930
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "b").WithArguments("b"),
Semantics\StackAllocInitializerTests.cs (19)
259
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj1").WithArguments("obj1").WithLocation(6, 40),
262
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj2").WithArguments("obj2").WithLocation(7, 40),
265
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj3").WithArguments("obj3").WithLocation(8, 40),
268
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj1").WithArguments("obj1").WithLocation(13, 40),
271
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj1").WithArguments("obj1").WithLocation(13, 50),
274
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj2").WithArguments("obj2").WithLocation(14, 40),
277
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj2").WithArguments("obj2").WithLocation(14, 50),
280
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj3").WithArguments("obj3").WithLocation(15, 40),
283
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj3").WithArguments("obj3").WithLocation(15, 50)
312
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj1").WithArguments("obj1").WithLocation(6, 54),
315
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj2").WithArguments("obj2").WithLocation(7, 54),
318
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj3").WithArguments("obj3").WithLocation(8, 54),
321
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj1").WithArguments("obj1").WithLocation(13, 54),
324
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj1").WithArguments("obj1").WithLocation(13, 64),
327
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj2").WithArguments("obj2").WithLocation(14, 54),
330
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj2").WithArguments("obj2").WithLocation(14, 64),
333
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj3").WithArguments("obj3").WithLocation(15, 54),
336
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "obj3").WithArguments("obj3").WithLocation(15, 64)
798
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x").WithLocation(6, 32)
Semantics\TopLevelStatementsTests.cs (1)
844
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "a").WithArguments("a").WithLocation(2, 1)
Semantics\UsingStatementTests.cs (1)
1825
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "v").WithArguments("v").WithLocation(6, 24)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\RawInterpolatedStringLiteralCompilingTests.cs (1)
2162
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x").WithLocation(4, 20));