353 references to WRN_UnreferencedVar
Microsoft.CodeAnalysis.CSharp (4)
Errors\ErrorFacts.cs (2)
253
case ErrorCode.
WRN_UnreferencedVar
:
691
case ErrorCode.
WRN_UnreferencedVar
:
FlowAnalysis\DefiniteAssignment.cs (1)
2163
Diagnostics.Add(assigned && _writtenVariables.Contains(symbol) ? ErrorCode.WRN_UnreferencedVarAssg : ErrorCode.
WRN_UnreferencedVar
, symbol.Locations.FirstOrNone(), symbol.Name);
Generated\ErrorFacts.Generated.cs (1)
18
case ErrorCode.
WRN_UnreferencedVar
:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (11)
BreakingChanges.cs (1)
1472
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "A5").WithArguments("A5"),
CodeGen\CodeGenDeconstructTests.cs (6)
6484
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "_").WithArguments("_").WithLocation(10, 17)
7096
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "_").WithArguments("_").WithLocation(6, 13)
9716
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x1").WithArguments("x1").WithLocation(6, 13),
9722
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "y2").WithArguments("y2").WithLocation(8, 16),
9754
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "y1").WithArguments("y1").WithLocation(7, 16),
9763
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x2").WithArguments("x2").WithLocation(11, 13));
CodeGen\CodeGenTupleTest.cs (1)
10750
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "y").WithArguments("y").WithLocation(6, 39)
Emit\DynamicAnalysis\DynamicInstrumentationTests.cs (3)
1130
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(14, 13),
1131
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "a").WithArguments("a").WithLocation(15, 13),
1132
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "b").WithArguments("b").WithLocation(15, 16));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (61)
Diagnostics\GetDiagnosticsTests.cs (2)
454
var expected = Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(11, 13);
508
var expected = Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 13);
FlowAnalysis\FlowTests.cs (15)
1116
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1122
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1125
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1131
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1137
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1143
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1149
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1152
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1155
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1158
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1161
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1164
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1167
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"),
1170
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e"));
5205
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(9, 33));
Semantics\PatternMatchingTests.cs (1)
4877
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "_").WithArguments("_").WithLocation(6, 41),
Semantics\PatternMatchingTests_Global.cs (30)
111
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
233
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
410
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
574
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8)
795
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
933
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
1065
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
1197
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
1365
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
1491
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
1626
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
1774
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
2721
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
2867
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
3112
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
3271
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
3417
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
3619
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(10, 8),
3790
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(10, 8),
4021
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
4219
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
4435
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(10, 8),
4447
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x6").WithArguments("x6").WithLocation(19, 10),
4602
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(10, 8),
4614
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x6").WithArguments("x6").WithLocation(19, 10),
5954
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "a").WithArguments("a").WithLocation(3, 6),
5957
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "b").WithArguments("b").WithLocation(3, 9),
6044
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "a").WithArguments("a").WithLocation(3, 6),
6047
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "b").WithArguments("b").WithLocation(3, 9),
6751
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x2").WithArguments("x2").WithLocation(7, 8),
Semantics\PatternMatchingTests_Scope.cs (13)
11786
(int)ErrorCode.
WRN_UnreferencedVar
11877
(int)ErrorCode.
WRN_UnreferencedVar
11971
(int)ErrorCode.
WRN_UnreferencedVar
,
12063
(int)ErrorCode.
WRN_UnreferencedVar
,
12186
(int)ErrorCode.
WRN_UnreferencedVar
12400
(int)ErrorCode.
WRN_UnreferencedVar
,
12559
(int)ErrorCode.
WRN_UnreferencedVar
,
12743
(int)ErrorCode.
WRN_UnreferencedVar
,
12888
(int)ErrorCode.
WRN_UnreferencedVar
,
12978
(int)ErrorCode.
WRN_UnreferencedVar
,
13140
(int)ErrorCode.
WRN_UnreferencedVar
,
13300
(int)ErrorCode.
WRN_UnreferencedVar
,
13867
int[] exclude = new int[] { (int)ErrorCode.ERR_NoImplicitConv, (int)ErrorCode.
WRN_UnreferencedVar
};
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (37)
IOperation\IOperationTests_IAwaitExpression.cs (1)
226
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "t").WithArguments("t").WithLocation(9, 25)
IOperation\IOperationTests_IIsPatternExpression.cs (1)
506
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "y").WithArguments("y").WithLocation(8, 49)
IOperation\IOperationTests_InvalidStatement.cs (1)
63
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(8, 23)
IOperation\IOperationTests_IPatternSwitchCase.cs (1)
635
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "y").WithArguments("y").WithLocation(9, 49)
IOperation\IOperationTests_IVariableDeclaration.cs (26)
47
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "i1").WithArguments("i1").WithLocation(6, 23)
149
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "i1").WithArguments("i1").WithLocation(6, 23),
152
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "i2").WithArguments("i2").WithLocation(6, 27)
271
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "i").WithArguments("i").WithLocation(6, 23)
452
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "a").WithArguments("a").WithLocation(6, 29)
493
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "a").WithArguments("a").WithLocation(6, 29),
496
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "b").WithArguments("b").WithLocation(6, 32)
590
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(6, 23)
749
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(6, 27)
786
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 29)
828
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 28)
899
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(6, 38)
991
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(6, 38)
1044
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(6, 39)
1097
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "y").WithArguments("y").WithLocation(6, 42)
1153
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "y").WithArguments("y").WithLocation(6, 43)
1194
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 33)
1237
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 38)
1274
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(8, 24)
1325
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 35)
1385
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 52)
2689
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "j").WithArguments("j").WithLocation(6, 31)
3059
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "i1").WithArguments("i1").WithLocation(6, 29)
3100
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "i1").WithArguments("i1").WithLocation(6, 29),
3103
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "i2").WithArguments("i2").WithLocation(6, 33)
3147
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "i1").WithArguments("i1").WithLocation(6, 29)
IOperation\IOperationTests_TryCatch.cs (7)
194
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(9, 38)
311
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(9, 38)
381
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(9, 38)
710
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(11, 26)
798
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(9, 30)
6422
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(10, 46)
6519
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(12, 50)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (118)
Semantics\BindingAsyncTests.cs (1)
3197
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "tr").WithArguments("tr"));
Semantics\ColorColorTests.cs (11)
168
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "Color").WithArguments("Color"));
763
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "E").WithArguments("E").WithLocation(18, 15),
766
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "Q").WithArguments("Q").WithLocation(19, 15)
802
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "E").WithArguments("E").WithLocation(18, 15),
805
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "Q").WithArguments("Q").WithLocation(19, 15)
841
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "E").WithArguments("E").WithLocation(18, 15),
844
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "Q").WithArguments("Q").WithLocation(19, 15)
880
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "E").WithArguments("E").WithLocation(18, 15),
883
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "Q").WithArguments("Q").WithLocation(19, 15)
1326
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "E").WithArguments("E").WithLocation(16, 15)
1385
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "E").WithArguments("E").WithLocation(16, 15)
Semantics\LocalFunctionTests.cs (6)
2981
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "T").WithArguments("T").WithLocation(6, 13));
2987
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "T").WithArguments("T").WithLocation(6, 13));
3036
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "Conflict").WithArguments("Conflict").WithLocation(6, 13),
3063
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "Conflict").WithArguments("Conflict").WithLocation(7, 13),
3909
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "Goo").WithArguments("Goo").WithLocation(6, 13),
3912
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "Bar").WithArguments("Bar").WithLocation(13, 13)
Semantics\NameCollisionTests.cs (8)
1785
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x1").WithArguments("x1").WithLocation(8, 13),
1794
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x2").WithArguments("x2").WithLocation(18, 13)
1803
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x1").WithArguments("x1").WithLocation(8, 13),
1809
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x2").WithArguments("x2").WithLocation(18, 13)
1848
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x1").WithArguments("x1").WithLocation(9, 13),
1857
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x2").WithArguments("x2").WithLocation(19, 13)
1866
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x1").WithArguments("x1").WithLocation(9, 13),
1872
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x2").WithArguments("x2").WithLocation(19, 13)
Semantics\NullableReferenceTypesTests.cs (4)
1143
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "y").WithArguments("y").WithLocation(6, 16),
4095
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(12, 34),
4107
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(35, 33),
111155
#pragma warning disable {(int)ErrorCode.
WRN_UnreferencedVar
}
Semantics\OutVarTests.cs (49)
20723
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "d").WithArguments("d").WithLocation(10, 13),
20726
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(10, 16),
20888
(int)ErrorCode.
WRN_UnreferencedVar
20998
(int)ErrorCode.
WRN_UnreferencedVar
21098
(int)ErrorCode.
WRN_UnreferencedVar
,
21196
(int)ErrorCode.
WRN_UnreferencedVar
,
21331
(int)ErrorCode.
WRN_UnreferencedVar
21557
(int)ErrorCode.
WRN_UnreferencedVar
,
21722
(int)ErrorCode.
WRN_UnreferencedVar
,
21912
(int)ErrorCode.
WRN_UnreferencedVar
,
22063
(int)ErrorCode.
WRN_UnreferencedVar
,
22159
(int)ErrorCode.
WRN_UnreferencedVar
,
22327
(int)ErrorCode.
WRN_UnreferencedVar
,
22493
(int)ErrorCode.
WRN_UnreferencedVar
,
23406
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x2").WithArguments("x2").WithLocation(7, 8),
25543
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
25668
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
25855
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
26024
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8)
26261
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
26404
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
26544
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
26688
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
26870
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
27001
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
27150
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8)
27303
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8)
28283
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
28434
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
28691
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
28857
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
29008
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
29220
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(10, 8),
29396
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(10, 8),
29689
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
29890
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 8),
30118
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(10, 8),
30130
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x6").WithArguments("x6").WithLocation(19, 10),
30290
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(10, 8),
30302
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x6").WithArguments("x6").WithLocation(19, 10),
31731
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "a").WithArguments("a").WithLocation(3, 6),
31734
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "b").WithArguments("b").WithLocation(3, 9),
31824
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "a").WithArguments("a").WithLocation(3, 6),
31827
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "b").WithArguments("b").WithLocation(3, 9),
34198
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x1").WithArguments("x1").WithLocation(7, 27),
34201
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "_1").WithArguments("_1").WithLocation(7, 36),
34204
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x2").WithArguments("x2").WithLocation(8, 27),
34207
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x2").WithArguments("x2").WithLocation(8, 36)
34425
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x2").WithArguments("x2").WithLocation(21, 46)
Semantics\OverloadResolutionPerfTests.cs (1)
787
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "tmp2").WithArguments("tmp2").WithLocation(9, 13));
Semantics\RecordTests.cs (1)
2522
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "with").WithArguments("with").WithLocation(7, 11),
Semantics\RefFieldTests.cs (14)
10829
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "r").WithArguments("r").WithLocation(6, 35),
10853
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "r").WithArguments("r").WithLocation(7, 39),
10877
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "r").WithArguments("r").WithLocation(8, 39),
11320
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "record").WithArguments("record").WithLocation(3, 17),
12564
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "R").WithArguments("R").WithLocation(6, 23),
12576
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "scoped").WithArguments("scoped").WithLocation(7, 16),
12602
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "R").WithArguments("R").WithLocation(1, 15),
12611
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "scoped").WithArguments("scoped").WithLocation(2, 8),
13255
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "a").WithArguments("a").WithLocation(6, 38),
13289
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "a").WithArguments("a").WithLocation(6, 43),
17579
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "S").WithArguments("S").WithLocation(6, 29),
17597
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "S").WithArguments("S").WithLocation(7, 36),
21514
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "R").WithArguments("R").WithLocation(5, 20),
21544
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "R").WithArguments("R").WithLocation(5, 27),
Semantics\RefLocalsAndReturnsTests.cs (2)
106
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "rx").WithArguments("rx").WithLocation(7, 22));
1551
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(6, 17)
Semantics\SemanticAnalyzerTests.cs (8)
209
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x1").WithArguments("x1").WithLocation(7, 12),
212
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x2").WithArguments("x2").WithLocation(8, 14),
215
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x3").WithArguments("x3").WithLocation(9, 15),
218
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x4").WithArguments("x4").WithLocation(10, 17));
937
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "i").WithArguments("i").WithLocation(7, 13),
940
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "j").WithArguments("j").WithLocation(8, 13),
943
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "k").WithArguments("k").WithLocation(9, 14),
946
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "i").WithArguments("i").WithLocation(9, 17));
Semantics\SemanticErrorTests.cs (11)
2734
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(2, 5)
4792
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "s").WithArguments("s")
9426
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(6, 16));
12131
new ErrorDescription { Code = (int)ErrorCode.
WRN_UnreferencedVar
, Line = 6, Column = 13, IsWarning = true }});
15334
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e")
19069
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "j").WithArguments("j").WithLocation(11, 13),
19070
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "a").WithArguments("a").WithLocation(13, 13));
19089
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(7, 42),
19090
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(8, 37));
23859
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(11, 17),
23862
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(14, 17)
Semantics\TopLevelStatementsTests.cs (1)
4310
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "I1").WithArguments("I1").WithLocation(4, 6),
Semantics\TryCatchTests.cs (1)
76
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "e").WithArguments("e").WithLocation(9, 20));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (7)
Symbols\FunctionPointerTypeSymbolTests.cs (4)
1112
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "local1").WithArguments("local1").WithLocation(8, 25),
1118
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "local2").WithArguments("local2").WithLocation(9, 37));
1143
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "local").WithArguments("local").WithLocation(7, 27));
1254
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "d").WithArguments("d").WithLocation(10, 24));
Symbols\SymbolErrorTests.cs (3)
1095
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "value__").WithArguments("value__"),
2490
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "a").WithArguments("a"),
2493
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "value").WithArguments("value")
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (115)
Diagnostics\DiagnosticTest.cs (86)
576
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
594
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithWarningAsError(true),
603
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
639
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
647
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
653
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
687
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
698
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithWarningAsError(true),
707
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
746
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
757
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
766
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
802
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
813
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
822
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
857
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
868
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithWarningAsError(true),
877
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
915
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
926
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithWarningAsError(true),
935
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
971
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 13),
977
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithLocation(10, 13));
985
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 13).WithWarningAsError(true),
991
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithLocation(10, 13).WithWarningAsError(true));
997
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 13),
1003
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithLocation(10, 13));
1038
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 13),
1044
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithLocation(10, 13),
1047
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "w").WithArguments("w").WithLocation(12, 13));
1055
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 13).WithWarningAsError(true),
1061
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithLocation(10, 13).WithWarningAsError(true),
1064
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "w").WithArguments("w").WithLocation(12, 13).WithWarningAsError(true));
1070
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 13),
1076
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithLocation(10, 13),
1079
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "w").WithArguments("w").WithLocation(12, 13));
1112
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 13),
1118
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithLocation(10, 13));
1126
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 13).WithWarningAsError(true),
1132
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithLocation(10, 13).WithWarningAsError(true));
1138
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(7, 13),
1144
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithLocation(10, 13));
1183
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1191
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
1197
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1236
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1244
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
1250
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1290
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1298
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
1304
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1391
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1399
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
1405
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1441
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
1447
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1458
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithWarningAsError(true),
1464
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
1472
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
1478
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1508
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
1514
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1522
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithWarningAsError(true),
1528
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
1558
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
1564
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1575
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithWarningAsError(true),
1581
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
1614
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
1620
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1628
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithWarningAsError(true),
1634
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
1667
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
1678
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
1734
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
1745
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithWarningAsError(true),
1783
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
1797
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithWarningAsError(true),
1847
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithLocation(14, 13),
2043
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithLocation(12, 13));
2102
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
2138
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x")
2207
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x"),
2210
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z"));
2227
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "x").WithArguments("x").WithWarningAsError(true),
2230
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "z").WithArguments("z").WithWarningAsError(true));
Parsing\DeclarationScopeParsingTests.cs (3)
3293
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "A").WithArguments("A").WithLocation(2, 15));
3306
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "A").WithArguments("A").WithLocation(2, 15));
3316
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "A").WithArguments("A").WithLocation(2, 15));
Parsing\FileModifierParsingTests.cs (8)
143
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "file").WithArguments("file").WithLocation(1, 9),
283
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "partial").WithArguments("partial").WithLocation(1, 6),
345
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "partial").WithArguments("partial").WithLocation(1, 6),
408
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "file").WithArguments("file").WithLocation(1, 9),
3030
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "file").WithArguments("file").WithLocation(3, 10)
3091
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "file").WithArguments("file").WithLocation(3, 9)
3152
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "file").WithArguments("file").WithLocation(1, 6)
3193
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "file").WithArguments("file").WithLocation(1, 5)
Parsing\FunctionPointerTests.cs (1)
531
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "ptr").WithArguments("ptr").WithLocation(1, 46));
Parsing\LocalFunctionParsingTests.cs (3)
982
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "local").WithArguments("local").WithLocation(6, 20));
1067
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "local1").WithArguments("local1").WithLocation(6, 20),
1070
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "local2").WithArguments("local2").WithLocation(6, 28));
Parsing\ParserErrorMessageTests.cs (8)
705
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "myarray").WithArguments("myarray").WithLocation(7, 16),
720
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "b").WithArguments("b").WithLocation(9, 20),
726
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "d").WithArguments("d").WithLocation(10, 24),
1054
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "myarray").WithArguments("myarray").WithLocation(6, 13),
1057
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "m").WithArguments("m").WithLocation(7, 17),
1060
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "b").WithArguments("b").WithLocation(8, 14),
1063
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "d").WithArguments("d").WithLocation(9, 16)
2484
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "j").WithArguments("j").WithLocation(6, 39));
Parsing\RecordParsing.cs (2)
276
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "Point").WithArguments("Point").WithLocation(1, 8));
3737
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "R").WithArguments("R").WithLocation(1, 12));
Parsing\StatementAttributeParsingTests.cs (4)
4252
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "a").WithArguments("a").WithLocation(6, 18));
6431
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "i").WithArguments("i").WithLocation(6, 16));
6515
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "i").WithArguments("i").WithLocation(6, 16),
6518
Diagnostic(ErrorCode.
WRN_UnreferencedVar
, "j").WithArguments("j").WithLocation(6, 19));