293 references to ERR_VariableUsedBeforeDeclaration
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Expressions.cs (1)
2090
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)
1823
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(6, 15)
1855
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(6, 19)
1919
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(6, 19)
1973
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(9, 15),
2083
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(9, 11),
2194
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(9, 15),
2304
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(9, 11),
2614
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(34, 21),
2831
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(34, 21),
3184
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(13, 16),
3286
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(13, 16),
3811
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(14, 19),
3814
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(22, 19),
3820
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(32, 19),
3823
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(40, 16),
3826
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(39, 19),
3832
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x8").WithArguments("x8").WithLocation(56, 19),
3838
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(66, 19),
3844
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(68, 23),
3859
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x14").WithArguments("x14").WithLocation(112, 19)
4256
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 29),
4460
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(18, 30),
4476
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(18, 30),
4658
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 19),
4893
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(21, 15),
4911
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(79, 15)
5160
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 18),
5255
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(6, 13),
5382
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 24),
5883
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 31),
6298
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
6536
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
6777
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
7035
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
7273
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
7514
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(13, 54),
7559
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(77, 23),
7589
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x12").WithArguments("x12").WithLocation(105, 20),
7619
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x15").WithArguments("x15").WithLocation(133, 20)
7765
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(13, 20),
8358
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 33),
8636
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(58, 13),
8642
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(83, 19),
9068
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(27, 49),
9086
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x12").WithArguments("x12").WithLocation(82, 15)
9126
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(27, 49),
9156
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x12").WithArguments("x12").WithLocation(82, 15)
9326
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 23),
9419
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 26),
9496
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(13, 56),
9578
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(31, 27)
9882
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 24),
9977
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 34),
10056
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(13, 56),
10143
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(31, 41)
10694
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 21),
10700
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(60, 19),
11018
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(11, 25),
11155
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(11, 25),
11251
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 25),
13172
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(21, 22),
13193
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(79, 15),
13585
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(47, 17),
13591
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(71, 23),
14074
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(30, 31),
14089
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x9").WithArguments("x9").WithLocation(112, 31),
15093
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(21, 21),
15114
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(79, 15),
15504
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 22),
15717
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 30),
15930
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 45),
16060
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x1").WithArguments("x1").WithLocation(12, 63),
16153
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(39, 46)
16373
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 16),
16936
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(23, 28),
16954
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(72, 15)
17330
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x2").WithArguments("x2").WithLocation(21, 15),
17375
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x11").WithArguments("x11").WithLocation(79, 15),
20897
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(24, 23),
21117
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(31, 27)
21221
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(31, 27)
21586
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(42, 20),
21768
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(12, 22),
21976
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 30),
22222
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(39, 46)
22389
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(35, 31),
22758
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(10, 18),
23177
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(20, 13),
23265
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(20, 13),
23631
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(25, 15),
23729
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(25, 15),
23969
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(18, 25),
24073
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(18, 25),
24265
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(6, 41),
24356
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(6, 41),
24380
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x12").WithArguments("x12").WithLocation(37, 9),
25254
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(18, 14),
25350
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x6").WithArguments("x6").WithLocation(18, 14),
26063
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x5").WithArguments("x5").WithLocation(16, 29),
33756
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(8, 23),
33854
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(8, 19),
33953
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x4").WithArguments("x4").WithLocation(8, 23),
34051
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)
7780
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "s").WithArguments("s").WithLocation(5, 33));
7804
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "lam").WithArguments("lam").WithLocation(7, 33));
7828
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "lam").WithArguments("lam").WithLocation(7, 40));
7852
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "lam").WithArguments("lam").WithLocation(7, 33),
8193
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)
55753
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x").WithLocation(5, 29),
59146
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "t").WithArguments("t").WithLocation(5, 9),
59366
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "s").WithArguments("s").WithLocation(5, 17));
81349
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "a").WithArguments("a").WithLocation(11, 27));
81393
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "b").WithArguments("b").WithLocation(11, 27));
161183
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)
12899
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "j").WithArguments("j"),
12919
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "b").WithArguments("b"),
12920
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "y").WithArguments("y"));
12941
Diagnostic(ErrorCode.
ERR_VariableUsedBeforeDeclaration
, "x").WithArguments("x"));
12975
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));