299 references to WRN_UnreferencedField
Microsoft.CodeAnalysis.CSharp (4)
Errors\ErrorFacts.cs (2)
272
case ErrorCode.
WRN_UnreferencedField
:
598
or ErrorCode.
WRN_UnreferencedField
Generated\ErrorFacts.Generated.cs (1)
19
case ErrorCode.
WRN_UnreferencedField
:
Symbols\Source\SourceAssemblySymbol.cs (1)
2744
diagnostics.Add(ErrorCode.
WRN_UnreferencedField
, field.GetFirstLocationOrNone(), field);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
CommandLineTests.cs (1)
12743
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"));
5691
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)
13639
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)
2639
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("Extensions.extension(object).field").WithLocation(5, 31));
Semantics\OutVarTests.cs (2)
22638
(int)ErrorCode.
WRN_UnreferencedField
22751
(int)ErrorCode.
WRN_UnreferencedField
,
Semantics\PatternMatchingTests_Scope.cs (2)
13435
(int)ErrorCode.
WRN_UnreferencedField
13513
(int)ErrorCode.
WRN_UnreferencedField
,
Semantics\PatternMatchingTests5.cs (2)
750
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Field1").WithArguments("C.Field1").WithLocation(4, 7),
753
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Field2").WithArguments("C.Field2").WithLocation(4, 15),
Semantics\PrimaryConstructorTests.cs (1)
13108
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),
14546
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("C.X").WithLocation(6, 9)
14556
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 (94)
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"),
1366
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)
4031
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Ptr").WithArguments("C.Ptr").WithLocation(4, 28)
4054
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)
114908
#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)
20026
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("R<T>.F").WithLocation(4, 19));
21997
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "R").WithArguments("R.R").WithLocation(3, 16),
22026
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "R").WithArguments("R.R").WithLocation(3, 16),
22173
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)
3280
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("Base.P.X"));
12990
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("Base.i"),
12993
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "j").WithArguments("Derived.j"));
13071
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "num").WithArguments("MyClass.num")
19403
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("ClassX.i")
19432
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "ActuallyPrivate").WithArguments("InternalClass.ActuallyPrivate"),
19468
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "ActuallyPrivate").WithArguments("InternalClass.ActuallyPrivate"),
23159
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 (55)
2700
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f0").WithArguments("C<T>.f0"),
2702
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f1").WithArguments("C<T>.f1"),
2704
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f2").WithArguments("C<T>.f2"),
2706
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f3").WithArguments("C<T>.f3"),
2708
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f4").WithArguments("C<T>.f4"),
2710
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f5").WithArguments("C<T>.f5"),
2712
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f6").WithArguments("C<T>.f6"),
2714
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f7").WithArguments("C<T>.f7"));
11512
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "px").WithArguments("Test.px"));
11532
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b")
11548
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(8, 30)
11576
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(8, 30)
11583
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(8, 30)
11630
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
11633
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
11636
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30),
11639
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28)
11658
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28),
11661
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
11664
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
11667
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30)
11708
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
11711
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30),
11714
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28),
11717
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22));
11721
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30),
11724
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
11727
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
11733
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28));
11744
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28),
11747
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
11750
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
11753
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30));
11757
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30),
11760
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
11763
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
11769
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28));
11799
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35),
11802
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33)
11821
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33),
11824
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35)
11861
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33),
11864
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35));
11868
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35),
11874
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33));
11885
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33),
11888
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35));
11892
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35),
11898
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33));
11989
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "p").WithArguments("C.p"));
12074
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "ptr").WithArguments("C<T>.ptr"));
13634
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S.x").WithLocation(6, 7));
13671
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S.x").WithLocation(6, 7));
14917
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("C<T>.field").WithLocation(3, 15)
14934
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("C<T>.field").WithLocation(3, 15));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (121)
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 (3)
6127
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("A.F").WithLocation(3, 10),
6129
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("B.F").WithLocation(7, 10));
7542
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "ptr").WithArguments("C.ptr").WithLocation(3, 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")
3222
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("C<T>.a").WithLocation(6, 8),
3225
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(7, 8),
3228
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(8, 14)
4782
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("NS.S.field")
4924
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("A.f"),
5440
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("NS.Test.field")
5533
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "var").WithArguments("NS.Test.var"));
5552
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "var").WithArguments("Test.var")
8878
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("D<T>.F").WithLocation(16, 18),
8881
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("H<T>.G").WithLocation(32, 7),
8884
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("C.G").WithLocation(12, 7),
8887
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("K.F").WithLocation(40, 14),
8890
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("G.F").WithLocation(28, 10),
8893
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("B.G").WithLocation(8, 7),
8896
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("J.F").WithLocation(36, 14),
8899
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("A.F").WithLocation(3, 7),
8902
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("E.F").WithLocation(20, 10),
8905
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("L.G").WithLocation(44, 14),
8908
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("B.F").WithLocation(7, 7),
8911
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("F<T>.G").WithLocation(24, 7)
8999
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Q").WithArguments("G.Q"),
9002
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Q").WithArguments("H<T>.Q")
9026
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("A.F").WithLocation(3, 7),
9029
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("B.G").WithLocation(7, 14)
9099
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("W<T>.x")
9132
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S2<T, U>.F").WithLocation(7, 14),
9135
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S3<T>.F").WithLocation(11, 7),
9138
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S4<T>.F").WithLocation(15, 15),
9141
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S1<T, U>.F").WithLocation(3, 24)
9204
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S1<T>.x").WithLocation(8, 18),
9207
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S4<T>.x").WithLocation(23, 18),
9210
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S3<T>.x").WithLocation(18, 18),
9213
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S0<T>.x").WithLocation(3, 18),
9216
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S2<T>.x").WithLocation(13, 18),
9219
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S5<T>.x").WithLocation(28, 18),
9222
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S6<T>.x").WithLocation(32, 20));
10015
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "D").WithArguments("NS.E.D"),
10018
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "E").WithArguments("NS.E.E"),
10021
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("NS.E.F"),
10024
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Q").WithArguments("NS.R.Q"),
10027
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "R").WithArguments("NS.R.R"));
10994
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("x.cly.a").WithLocation(12, 13),
11000
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("x.cly.i").WithLocation(13, 13),
11012
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("x.cly.a").WithLocation(12, 13),
11015
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("x.cly.i").WithLocation(13, 13),
11118
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("NS.S.field")
11455
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("MainClass.i")
12433
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Field1").WithArguments("NS.Goo.SGoo.Field1"),
12509
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("TestClass.i")
12552
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C1<T>.f"),
12554
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C2<T>.f"),
12556
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C3<T>.f"),
12558
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C4<T>.f"),
12560
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C5<T>.f"));
12580
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("TestClass.i"));
13142
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("NS.Goo.i"),
13145
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("NS.Bar<T>.field"));
13609
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("NS.Test.X"),
13612
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Y").WithArguments("NS.Test.Y"),
13615
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Z").WithArguments("NS.Test.Z"));
14218
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C.f").WithLocation(4, 17));
14650
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "myStaticField").WithArguments("NS.Test.myStaticField")
15110
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("B.F"));
16134
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Age").WithArguments("A.Age")
17675
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("A.i"),
17678
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "j").WithArguments("A.j"));
17778
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "cls").WithArguments("SA.Test.cls"));
19596
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_P").WithArguments("C.get_P"));
19682
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "A").WithArguments("C<A, B, D, E, F, G>.A"));
19746
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "T").WithArguments("N.S.T"),
19749
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "I").WithArguments("N.S.I")
19815
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "T").WithArguments("C.S.T"),
19818
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "I").WithArguments("C.S.I")
19859
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "add_E").WithArguments("C.add_E"),
19935
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Item").WithArguments("S.Item"),
19938
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "P").WithArguments("S.P"),
19941
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_Item").WithArguments("A.get_Item"),
19944
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "set_Item").WithArguments("A.set_Item"),
19947
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_Item").WithArguments("B.get_Item"),
19950
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_P").WithArguments("B.get_P"),
19975
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Item").WithArguments("A.Item"));
19983
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_Item").WithArguments("A.get_Item"));
19990
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "set_Item").WithArguments("A.set_Item"));
20018
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "P").WithArguments("A.P"));
20026
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_P").WithArguments("A.get_P"));
20033
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "set_P").WithArguments("A.set_P"));
20047
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Item").WithArguments("A.Item"));
20051
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_Item").WithArguments("A.get_Item"));
20055
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "set_Item").WithArguments("A.set_Item"));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (20)
Diagnostics\DiagnosticTest.cs (1)
2970
case ErrorCode.
WRN_UnreferencedField
:
Parsing\ExtensionsParsingTests.cs (1)
3274
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("C.extension(object).field").WithLocation(5, 13));
Parsing\FileModifierParsingTests.cs (5)
873
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.x").WithLocation(3, 14)
1073
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "file").WithArguments("C.file").WithLocation(3, 9)
1288
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "async").WithArguments("C.async").WithLocation(3, 10)
1374
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "item").WithArguments("C.item").WithLocation(3, 10)
2924
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),
1697
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)
3703
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("D.x").WithLocation(11, 7),
3709
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("D.c").WithLocation(12, 7));
3853
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x1").WithArguments("D.x1").WithLocation(11, 7),
3859
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c1").WithArguments("D.c1").WithLocation(12, 9));
Syntax\FieldAndValueKeywordTests.cs (1)
1471
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("C.field").WithLocation(3, 16),
Syntax\SyntaxFactoryTests.cs (2)
696
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.x").WithLocation(1, 34));
704
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.x").WithLocation(1, 34));