296 references to WRN_UnreferencedField
Microsoft.CodeAnalysis.CSharp (4)
Errors\ErrorFacts.cs (2)
267
case ErrorCode.
WRN_UnreferencedField
:
593
or ErrorCode.
WRN_UnreferencedField
Generated\ErrorFacts.Generated.cs (1)
19
case ErrorCode.
WRN_UnreferencedField
:
Symbols\Source\SourceAssemblySymbol.cs (1)
2742
diagnostics.Add(ErrorCode.
WRN_UnreferencedField
, field.GetFirstLocationOrNone(), field);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
CommandLineTests.cs (1)
12663
new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.
WRN_UnreferencedField
, "C.f"), Location.None).GetMessage(CultureInfo.InvariantCulture),
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (8)
BreakingChanges.cs (2)
299
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S1<T>.x").WithLocation(3, 18),
302
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S1<T>.S2.x").WithLocation(6, 18)
CodeGen\CodeGenDeconstructTests.cs (2)
8925
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Item2").WithArguments("(T1, T2).Item2").WithLocation(13, 20)
8971
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Item2").WithArguments("(T1, T2).Item2").WithLocation(13, 20),
CodeGen\CodeGenTupleTest.cs (1)
234
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Item2").WithArguments("(T1, T2).Item2").WithLocation(7, 20),
CodeGen\DestructorTests.cs (1)
509
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Finalize").WithArguments("C.Finalize")
Emit\CompilationEmitTests.cs (2)
133
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "q").WithArguments("X.q"));
5610
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "_f").WithArguments("X._f").WithLocation(4, 9).WithWarningAsError(true));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
PDB\PDBUsingTests.cs (1)
3160
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("C.i"),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (43)
Attributes\AttributeTests.cs (8)
6110
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "t1").WithArguments("G<T>.t1"),
6113
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "t2").WithArguments("G<T>.t2"),
6116
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("X.x"),
6119
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "y").WithArguments("X.y")
6512
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "ProtectionLevel").WithArguments("F.ProtectionLevel"),
7677
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Goo3").WithArguments("C.Goo3").WithLocation(15, 17));
7736
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Goo3").WithArguments("C.Goo3").WithLocation(15, 17));
8046
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "PrivateField").WithArguments("B.PrivateField"),
Attributes\AttributeTests_LifetimeAnnotation.cs (1)
155
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("Program.F").WithLocation(6, 24),
Attributes\AttributeTests_Locations.cs (1)
504
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("C.a"));
Attributes\AttributeTests_WellKnownAttributes.cs (1)
13599
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("System.Runtime.CompilerServices.IsReadOnlyAttribute.F").WithLocation(6, 21));
Diagnostics\DiagnosticSuppressorTests.cs (2)
174
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f", isSuppressed: false).WithArguments("C.f").WithLocation(5, 26));
280
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C1.f").WithLocation(1, 33));
FlowAnalysis\FlowDiagnosticTests.cs (16)
948
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("A.a").WithLocation(4, 7));
993
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("B<T>.x").WithLocation(9, 20),
996
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("A<T>.x").WithLocation(4, 20),
999
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("D<T>.x").WithLocation(18, 20),
1002
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C<T>.x").WithLocation(14, 17),
1234
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "y").WithArguments("S.y").WithLocation(4, 12)
1241
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "y").WithArguments("S.y").WithLocation(4, 12));
1273
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "value").WithArguments("S.value")
1855
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "s3").WithArguments("T.s3").WithLocation(13, 15),
1858
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "s2").WithArguments("T.s2").WithLocation(13, 11),
1861
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "s1").WithArguments("T.s1").WithLocation(13, 7)
1876
Assert.Equal(ErrorCode.
WRN_UnreferencedField
, (ErrorCode)bindingDiags[0].Code);
2424
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.S.x").WithLocation(5, 13)
2434
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.S.x").WithLocation(5, 13)
2581
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("Derived.x").WithLocation(8, 17)
2591
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("Derived.x").WithLocation(8, 17)
Semantics\ExtensionTests.cs (1)
2481
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("Extensions.extension(object).field").WithLocation(5, 31));
Semantics\OutVarTests.cs (2)
22649
(int)ErrorCode.
WRN_UnreferencedField
22762
(int)ErrorCode.
WRN_UnreferencedField
,
Semantics\PatternMatchingTests_Scope.cs (2)
13435
(int)ErrorCode.
WRN_UnreferencedField
13513
(int)ErrorCode.
WRN_UnreferencedField
,
Semantics\PatternMatchingTests5.cs (2)
749
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Field1").WithArguments("C.Field1").WithLocation(4, 7),
752
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Field2").WithArguments("C.Field2").WithLocation(4, 15),
Semantics\PrimaryConstructorTests.cs (1)
12968
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "s_f").WithArguments("C.s_f").WithLocation(9, 7)
Semantics\RecordTests.cs (6)
3278
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Clone").WithArguments("C2.Clone").WithLocation(5, 12),
3290
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Clone").WithArguments("C4.Clone").WithLocation(13, 17),
5718
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field3").WithArguments("C1.field3").WithLocation(10, 20),
5781
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Property2").WithArguments("C1.Property2").WithLocation(7, 17),
14564
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("C.X").WithLocation(6, 9)
14574
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("C.X").WithLocation(6, 9)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (7)
IOperation\IOperationTests_IVariableDeclaration.cs (7)
1539
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i1").WithArguments("Program.i1").WithLocation(4, 9)
1594
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i2").WithArguments("Program.i2").WithLocation(4, 13),
1597
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i1").WithArguments("Program.i1").WithLocation(4, 9)
1642
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i1").WithArguments("Program.i1").WithLocation(4, 9)
1693
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i2").WithArguments("Program.i2").WithLocation(4, 13),
1696
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i1").WithArguments("Program.i1").WithLocation(4, 9)
1754
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i2").WithArguments("Program.i2").WithLocation(4, 13)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (92)
Semantics\AccessCheckTests.cs (4)
119
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "n1_priv").WithArguments("C.N1.n1_priv"),
125
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "n2_priv").WithArguments("C.N1.N2.n2_priv"),
330
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "n3_priv").WithArguments("C.N3.n3_priv"),
1364
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "_UnusedField").WithArguments("Class1._UnusedField").WithLocation(4, 17));
Semantics\AccessibilityTests.cs (2)
265
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Fld3").WithArguments("RuleE<T>.Fld3"),
268
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F3").WithArguments("D<T>.F3"));
Semantics\FunctionPointerTests.cs (2)
4043
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Ptr").WithArguments("C.Ptr").WithLocation(4, 28)
4066
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Ptr").WithArguments("C.Ptr").WithLocation(5, 65)
Semantics\NameLengthTests.cs (4)
76
Diagnostic(ErrorCode.
WRN_UnreferencedField
, s_longSymbolName).WithArguments("Fields." + s_longSymbolName).WithLocation(6, 9),
79
Diagnostic(ErrorCode.
WRN_UnreferencedField
, s_longSymbolName + 1).WithArguments("Fields." + s_longSymbolName + 1).WithLocation(7, 9),
167
Diagnostic(ErrorCode.
WRN_UnreferencedField
, s_longSymbolName).WithArguments("Fields." + s_longSymbolName).WithLocation(6, 9),
170
Diagnostic(ErrorCode.
WRN_UnreferencedField
, s_longSymbolName + 1).WithArguments("Fields." + s_longSymbolName + 1).WithLocation(7, 9),
Semantics\NullableReferenceTypesTests.cs (1)
114836
#pragma warning disable {(int)ErrorCode.
WRN_UnreferencedField
}
Semantics\QueryTests.cs (1)
3000
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Color").WithArguments("Program.Color"),
Semantics\RecordStructTests.cs (1)
1457
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Clone").WithArguments("C2.Clone").WithLocation(5, 12),
Semantics\RefFieldTests.cs (4)
19992
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("R<T>.F").WithLocation(4, 19));
21963
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "R").WithArguments("R.R").WithLocation(3, 16),
21993
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "R").WithArguments("R.R").WithLocation(3, 16),
22181
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "R").WithArguments("R.R").WithLocation(3, 16),
Semantics\SemanticAnalyzerTests.cs (2)
116
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.x").WithLocation(5, 16),
825
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "static_readonly").WithArguments("C.static_readonly").WithLocation(12, 33),
Semantics\SemanticErrorTests.cs (8)
3235
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("Base.P.X"));
12936
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("Base.i"),
12939
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "j").WithArguments("Derived.j"));
13017
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "num").WithArguments("MyClass.num")
19333
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("ClassX.i")
19362
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "ActuallyPrivate").WithArguments("InternalClass.ActuallyPrivate"),
19398
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "ActuallyPrivate").WithArguments("InternalClass.ActuallyPrivate"),
23089
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "d2").WithArguments("CSSample.Program.d2").WithLocation(16, 19),
Semantics\StructConstructorTests.cs (4)
3061
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S.F").WithLocation(3, 20),
3333
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F0").WithArguments("S0.F0").WithLocation(4, 12));
3531
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("S1.X").WithLocation(3, 12),
3622
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("S1.X").WithLocation(6, 12),
Semantics\StructsTests.cs (1)
42
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("A.a").WithLocation(4, 7));
Semantics\UninitializedNonNullableFieldTests.cs (5)
94
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("C.G").WithLocation(4, 19));
117
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("C.G").WithLocation(5, 19));
142
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("C.G").WithLocation(4, 19));
637
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("C<T>.field").WithLocation(7, 7)
2128
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "_f").WithArguments("C._f").WithLocation(5, 20),
Semantics\UnsafeTests.cs (53)
2653
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f0").WithArguments("C<T>.f0"),
2655
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f1").WithArguments("C<T>.f1"),
2657
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f2").WithArguments("C<T>.f2"),
2659
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f3").WithArguments("C<T>.f3"),
2661
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f4").WithArguments("C<T>.f4"),
2663
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f5").WithArguments("C<T>.f5"),
2665
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f6").WithArguments("C<T>.f6"),
2667
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f7").WithArguments("C<T>.f7"));
11384
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "px").WithArguments("Test.px"));
11404
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b")
11417
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(8, 30)
11445
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(8, 30)
11452
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(8, 30)
11499
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
11502
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
11505
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30),
11508
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28)
11527
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28),
11530
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
11533
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
11536
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30)
11577
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
11580
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30),
11583
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28),
11586
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22));
11590
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30),
11593
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
11596
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
11602
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28));
11613
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28),
11616
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
11619
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
11622
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30));
11626
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30),
11629
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
11632
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
11638
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28));
11668
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35),
11671
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33)
11690
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33),
11693
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35)
11730
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33),
11733
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35));
11737
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35),
11743
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33));
11754
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33),
11757
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35));
11761
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35),
11767
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33));
11854
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "p").WithArguments("C.p"));
11939
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "ptr").WithArguments("C<T>.ptr"));
13269
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S.x").WithLocation(6, 7));
13304
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S.x").WithLocation(6, 7));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (120)
Compilation\SemanticModelAPITests.cs (1)
1718
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "q").WithArguments("Q.q"));
DocumentationComments\DocumentationCommentCompilerTests.cs (2)
3598
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("C.field"),
6568
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("Generic<T>.C.f"),
Symbols\ConversionTests.cs (1)
305
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("C.a")
Symbols\ExtensionMethodTests.cs (2)
1377
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("A.G"),
1380
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "H").WithArguments("A.H"));
Symbols\FunctionPointerTypeSymbolTests.cs (1)
1097
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "_field").WithArguments("C._field").WithLocation(4, 21),
Symbols\GenericConstraintTests.cs (2)
6116
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("A.F").WithLocation(3, 10),
6118
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("B.F").WithLocation(7, 10));
Symbols\IndexerTests.cs (1)
1635
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("A.x"));
Symbols\Metadata\PE\TypeForwarders.cs (1)
823
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("Test.F").WithLocation(6, 25)
Symbols\OverriddenOrHiddenMembersTests.cs (2)
1238
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "n").WithArguments("CSClass.n"),
1241
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "n").WithArguments("CSHide.n"));
Symbols\RequiredMembersTests.cs (1)
4788
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "_field").WithArguments("Derived._field").WithLocation(4, 20),
Symbols\Source\ClsComplianceTests.cs (3)
251
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F1").WithArguments("Levels.F1"),
254
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("Kinds.F"),
2044
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "_Private").WithArguments("Kinds._Private"),
Symbols\Source\DelegateTests.cs (1)
303
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "d3").WithArguments("CSSample.Program.d3"));
Symbols\Source\EnumTests.cs (1)
754
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "M").WithArguments("EnumPartial.M")
Symbols\Source\FieldTests.cs (2)
411
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("A.a"),
413
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("A.b"));
Symbols\Source\FileModifierTests.cs (2)
2173
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("E.field").WithLocation(8, 7),
2214
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("E.field").WithLocation(9, 13),
Symbols\Source\PropertyTests.cs (1)
168
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("S.a").WithLocation(4, 9));
Symbols\SymbolErrorTests.cs (96)
108
options: TestOptions.ReleaseDll.WithSpecificDiagnosticOptions(new Dictionary<string, ReportDiagnostic>() { { MessageProvider.Instance.GetIdForErrorCode((int)ErrorCode.
WRN_UnreferencedField
), ReportDiagnostic.Suppress } }),
1099
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "value__").WithArguments("C.value__")
1615
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("NS.S<X>.x"),
1618
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("NS.S<X>.x")
1682
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("n3.S.a").WithLocation(22, 11)
1728
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("MyNamespace.MyClass.field").WithLocation(11, 24),
2332
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "foundNamespaceInsteadOfType").WithArguments("NS.Bar.foundNamespaceInsteadOfType")
3193
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("C<T>.a").WithLocation(6, 8),
3196
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(7, 8),
3199
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(8, 14)
4753
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("NS.S.field")
4895
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("A.f"),
5411
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("NS.Test.field")
5504
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "var").WithArguments("NS.Test.var"));
5523
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "var").WithArguments("Test.var")
8838
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("D<T>.F").WithLocation(16, 18),
8841
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("H<T>.G").WithLocation(32, 7),
8844
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("C.G").WithLocation(12, 7),
8847
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("K.F").WithLocation(40, 14),
8850
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("G.F").WithLocation(28, 10),
8853
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("B.G").WithLocation(8, 7),
8856
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("J.F").WithLocation(36, 14),
8859
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("A.F").WithLocation(3, 7),
8862
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("E.F").WithLocation(20, 10),
8865
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("L.G").WithLocation(44, 14),
8868
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("B.F").WithLocation(7, 7),
8871
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("F<T>.G").WithLocation(24, 7)
8959
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Q").WithArguments("G.Q"),
8962
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Q").WithArguments("H<T>.Q")
8986
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("A.F").WithLocation(3, 7),
8989
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("B.G").WithLocation(7, 14)
9059
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("W<T>.x")
9092
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S2<T, U>.F").WithLocation(7, 14),
9095
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S3<T>.F").WithLocation(11, 7),
9098
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S4<T>.F").WithLocation(15, 15),
9101
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S1<T, U>.F").WithLocation(3, 24)
9164
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S1<T>.x").WithLocation(8, 18),
9167
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S4<T>.x").WithLocation(23, 18),
9170
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S3<T>.x").WithLocation(18, 18),
9173
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S0<T>.x").WithLocation(3, 18),
9176
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S2<T>.x").WithLocation(13, 18),
9179
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S5<T>.x").WithLocation(28, 18),
9182
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S6<T>.x").WithLocation(32, 20));
9975
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "D").WithArguments("NS.E.D"),
9978
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "E").WithArguments("NS.E.E"),
9981
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("NS.E.F"),
9984
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Q").WithArguments("NS.R.Q"),
9987
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "R").WithArguments("NS.R.R"));
10954
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("x.cly.a").WithLocation(12, 13),
10960
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("x.cly.i").WithLocation(13, 13),
10972
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("x.cly.a").WithLocation(12, 13),
10975
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("x.cly.i").WithLocation(13, 13),
11078
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("NS.S.field")
11415
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("MainClass.i")
12393
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Field1").WithArguments("NS.Goo.SGoo.Field1"),
12469
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("TestClass.i")
12512
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C1<T>.f"),
12514
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C2<T>.f"),
12516
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C3<T>.f"),
12518
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C4<T>.f"),
12520
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C5<T>.f"));
12540
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("TestClass.i"));
13102
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("NS.Goo.i"),
13105
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("NS.Bar<T>.field"));
13569
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("NS.Test.X"),
13572
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Y").WithArguments("NS.Test.Y"),
13575
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Z").WithArguments("NS.Test.Z"));
14178
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C.f").WithLocation(4, 17));
14610
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "myStaticField").WithArguments("NS.Test.myStaticField")
15070
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("B.F"));
16094
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Age").WithArguments("A.Age")
17635
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("A.i"),
17638
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "j").WithArguments("A.j"));
17738
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "cls").WithArguments("SA.Test.cls"));
19556
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_P").WithArguments("C.get_P"));
19642
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "A").WithArguments("C<A, B, D, E, F, G>.A"));
19706
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "T").WithArguments("N.S.T"),
19709
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "I").WithArguments("N.S.I")
19775
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "T").WithArguments("C.S.T"),
19778
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "I").WithArguments("C.S.I")
19819
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "add_E").WithArguments("C.add_E"),
19895
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Item").WithArguments("S.Item"),
19898
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "P").WithArguments("S.P"),
19901
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_Item").WithArguments("A.get_Item"),
19904
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "set_Item").WithArguments("A.set_Item"),
19907
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_Item").WithArguments("B.get_Item"),
19910
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_P").WithArguments("B.get_P"),
19935
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Item").WithArguments("A.Item"));
19943
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_Item").WithArguments("A.get_Item"));
19950
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "set_Item").WithArguments("A.set_Item"));
19978
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "P").WithArguments("A.P"));
19986
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_P").WithArguments("A.get_P"));
19993
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "set_P").WithArguments("A.set_P"));
20007
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Item").WithArguments("A.Item"));
20011
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_Item").WithArguments("A.get_Item"));
20015
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "set_Item").WithArguments("A.set_Item"));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (20)
Diagnostics\DiagnosticTest.cs (1)
2947
case ErrorCode.
WRN_UnreferencedField
:
Parsing\ExtensionsParsingTests.cs (1)
2862
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("C.extension(object).field").WithLocation(5, 13));
Parsing\FileModifierParsingTests.cs (5)
859
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.x").WithLocation(3, 14)
1062
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "file").WithArguments("C.file").WithLocation(3, 9)
1277
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "async").WithArguments("C.async").WithLocation(3, 10)
1363
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "item").WithArguments("C.item").WithLocation(3, 10)
2916
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("C.X").WithLocation(3, 17)
Parsing\ParserErrorMessageTests.cs (4)
744
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "myarray").WithArguments("MyClass.myarray").WithLocation(14, 19),
756
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("MyClass.b").WithLocation(16, 23),
762
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "d").WithArguments("MyClass.d").WithLocation(17, 27),
1679
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("x.clx.i").WithLocation(5, 13));
Parsing\SeparatedSyntaxListParsingTests.cs (2)
700
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a1").WithArguments("C.a1").WithLocation(6, 12),
712
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a1").WithArguments("C.a1").WithLocation(7, 12),
Parsing\UsingDirectiveParsingTests.cs (4)
3642
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("D.x").WithLocation(11, 7),
3648
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("D.c").WithLocation(12, 7));
3792
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x1").WithArguments("D.x1").WithLocation(11, 7),
3798
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c1").WithArguments("D.c1").WithLocation(12, 9));
Syntax\FieldAndValueKeywordTests.cs (1)
1468
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("C.field").WithLocation(3, 16),
Syntax\SyntaxFactoryTests.cs (2)
671
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.x").WithLocation(1, 34));
679
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.x").WithLocation(1, 34));