293 references to WRN_UnreferencedField
Microsoft.CodeAnalysis.CSharp (4)
Errors\ErrorFacts.cs (2)
254
case ErrorCode.
WRN_UnreferencedField
:
551
case ErrorCode.
WRN_UnreferencedField
:
Generated\ErrorFacts.Generated.cs (1)
19
case ErrorCode.
WRN_UnreferencedField
:
Symbols\Source\SourceAssemblySymbol.cs (1)
2698
diagnostics.Add(ErrorCode.
WRN_UnreferencedField
, field.Locations.FirstOrNone(), field);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
CommandLineTests.cs (1)
12344
new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.
WRN_UnreferencedField
, "C.f"), Location.None).GetMessage(CultureInfo.InvariantCulture),
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (9)
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)
132
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "q").WithArguments("X.q"));
5604
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "_f").WithArguments("X._f").WithLocation(4, 9).WithWarningAsError(true));
PDB\PDBUsingTests.cs (1)
2618
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("C.i"),
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (33)
Attributes\AttributeTests.cs (8)
5812
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "t1").WithArguments("G<T>.t1"),
5815
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "t2").WithArguments("G<T>.t2"),
5818
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("X.x"),
5821
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "y").WithArguments("X.y")
6214
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "ProtectionLevel").WithArguments("F.ProtectionLevel"),
7379
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Goo3").WithArguments("C.Goo3").WithLocation(15, 17));
7438
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Goo3").WithArguments("C.Goo3").WithLocation(15, 17));
7748
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)
13423
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("System.Runtime.CompilerServices.IsReadOnlyAttribute.F").WithLocation(6, 21));
Diagnostics\DiagnosticSuppressorTests.cs (2)
86
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f", isSuppressed: false).WithArguments("C.f").WithLocation(5, 26));
192
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C1.f").WithLocation(1, 33));
FlowAnalysis\FlowDiagnosticTests.cs (16)
941
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("A.a").WithLocation(4, 7));
981
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("B<T>.x").WithLocation(9, 20),
984
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("A<T>.x").WithLocation(4, 20),
987
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("D<T>.x").WithLocation(18, 20),
990
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C<T>.x").WithLocation(14, 17)
1216
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "y").WithArguments("S.y").WithLocation(4, 12)
1223
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "y").WithArguments("S.y").WithLocation(4, 12));
1255
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "value").WithArguments("S.value")
1837
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "s3").WithArguments("T.s3").WithLocation(13, 15),
1840
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "s2").WithArguments("T.s2").WithLocation(13, 11),
1843
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "s1").WithArguments("T.s1").WithLocation(13, 7)
1858
Assert.Equal(ErrorCode.
WRN_UnreferencedField
, (ErrorCode)bindingDiags[0].Code);
2406
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.S.x").WithLocation(5, 13)
2416
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.S.x").WithLocation(5, 13)
2563
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("Derived.x").WithLocation(8, 17)
2573
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("Derived.x").WithLocation(8, 17)
Semantics\PatternMatchingTests_Scope.cs (2)
13386
(int)ErrorCode.
WRN_UnreferencedField
13464
(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),
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 (101)
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)
4022
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Ptr").WithArguments("C.Ptr").WithLocation(4, 28)
4045
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)
111066
#pragma warning disable {(int)ErrorCode.
WRN_UnreferencedField
}
Semantics\OutVarTests.cs (2)
22590
(int)ErrorCode.
WRN_UnreferencedField
22703
(int)ErrorCode.
WRN_UnreferencedField
,
Semantics\PrimaryConstructorTests.cs (1)
11950
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "s_f").WithArguments("C.s_f").WithLocation(9, 7)
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\RecordTests.cs (6)
3223
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Clone").WithArguments("C2.Clone").WithLocation(5, 12),
3235
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Clone").WithArguments("C4.Clone").WithLocation(13, 17),
5663
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field3").WithArguments("C1.field3").WithLocation(10, 20),
5726
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Property2").WithArguments("C1.Property2").WithLocation(7, 17),
14461
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("C.X").WithLocation(6, 9)
14471
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("C.X").WithLocation(6, 9)
Semantics\RefFieldTests.cs (4)
19376
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("R<T>.F").WithLocation(4, 19));
21356
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "R").WithArguments("R.R").WithLocation(3, 16),
21386
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "R").WithArguments("R.R").WithLocation(3, 16),
21574
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)
3237
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("Base.P.X"));
12886
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("Base.i"),
12889
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "j").WithArguments("Derived.j"));
12967
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "num").WithArguments("MyClass.num")
19109
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("ClassX.i")
19138
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "ActuallyPrivate").WithArguments("InternalClass.ActuallyPrivate"),
19174
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "ActuallyPrivate").WithArguments("InternalClass.ActuallyPrivate"),
22833
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)
41
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)
394
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f0").WithArguments("C<T>.f0"),
396
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f1").WithArguments("C<T>.f1"),
398
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f2").WithArguments("C<T>.f2"),
400
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f3").WithArguments("C<T>.f3"),
402
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f4").WithArguments("C<T>.f4"),
404
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f5").WithArguments("C<T>.f5"),
406
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f6").WithArguments("C<T>.f6"),
408
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f7").WithArguments("C<T>.f7"));
8532
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "px").WithArguments("Test.px"));
8552
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b")
8565
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(8, 30)
8593
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(8, 30)
8600
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(8, 30)
8647
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
8650
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
8653
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30),
8656
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28)
8675
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28),
8678
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
8681
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
8684
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30)
8725
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
8728
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30),
8731
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28),
8734
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22));
8738
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30),
8741
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
8744
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
8750
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28));
8761
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28),
8764
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
8767
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
8770
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30));
8774
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 30),
8777
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b1").WithArguments("C<T>.b1").WithLocation(13, 22),
8780
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b2").WithArguments("C<T>.b2").WithLocation(14, 24),
8786
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(17, 28));
8816
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35),
8819
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33)
8838
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33),
8841
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35)
8878
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33),
8881
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35));
8885
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35),
8891
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33));
8902
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33),
8905
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35));
8909
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(10, 35),
8915
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(13, 33));
9002
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "p").WithArguments("C.p"));
9087
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "ptr").WithArguments("C<T>.ptr"));
10387
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S.x").WithLocation(6, 7));
10422
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)
1853
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("C.field"),
4823
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("Generic<T>.C.f"),
Symbols\ConversionTests.cs (1)
302
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("C.a")
Symbols\ExtensionMethodTests.cs (2)
1381
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("A.G"),
1384
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)
6089
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("A.F").WithLocation(3, 10),
6091
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("B.F").WithLocation(7, 10));
Symbols\IndexerTests.cs (1)
1633
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)
4159
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "_field").WithArguments("Derived._field").WithLocation(4, 20),
Symbols\Source\ClsComplianceTests.cs (3)
252
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F1").WithArguments("Levels.F1"),
255
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("Kinds.F"),
2045
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)
1892
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("E.field").WithLocation(8, 7),
1933
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("E.field").WithLocation(9, 13),
Symbols\Source\PropertyTests.cs (1)
167
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("S.a").WithLocation(4, 9));
Symbols\SymbolErrorTests.cs (96)
107
options: TestOptions.ReleaseDll.WithSpecificDiagnosticOptions(new Dictionary<string, ReportDiagnostic>() { { MessageProvider.Instance.GetIdForErrorCode((int)ErrorCode.
WRN_UnreferencedField
), ReportDiagnostic.Suppress } }),
1098
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "value__").WithArguments("C.value__")
1614
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("NS.S<X>.x"),
1617
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("NS.S<X>.x")
1681
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("n3.S.a").WithLocation(22, 11)
1727
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("MyNamespace.MyClass.field").WithLocation(11, 24),
2328
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "foundNamespaceInsteadOfType").WithArguments("NS.Bar.foundNamespaceInsteadOfType")
3178
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("C<T>.a").WithLocation(6, 8),
3181
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "b").WithArguments("C<T>.b").WithLocation(7, 8),
3184
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("C<T>.c").WithLocation(8, 14)
4677
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("NS.S.field")
4819
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("A.f"),
5335
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("NS.Test.field")
5428
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "var").WithArguments("NS.Test.var"));
5447
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "var").WithArguments("Test.var")
8695
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("D<T>.F").WithLocation(16, 18),
8698
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("H<T>.G").WithLocation(32, 7),
8701
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("C.G").WithLocation(12, 7),
8704
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("K.F").WithLocation(40, 14),
8707
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("G.F").WithLocation(28, 10),
8710
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("B.G").WithLocation(8, 7),
8713
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("J.F").WithLocation(36, 14),
8716
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("A.F").WithLocation(3, 7),
8719
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("E.F").WithLocation(20, 10),
8722
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("L.G").WithLocation(44, 14),
8725
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("B.F").WithLocation(7, 7),
8728
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("F<T>.G").WithLocation(24, 7)
8816
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Q").WithArguments("G.Q"),
8819
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Q").WithArguments("H<T>.Q")
8843
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("A.F").WithLocation(3, 7),
8846
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "G").WithArguments("B.G").WithLocation(7, 14)
8916
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("W<T>.x")
8949
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S2<T, U>.F").WithLocation(7, 14),
8952
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S3<T>.F").WithLocation(11, 7),
8955
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S4<T>.F").WithLocation(15, 15),
8958
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("S1<T, U>.F").WithLocation(3, 24)
9021
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S1<T>.x").WithLocation(8, 18),
9024
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S4<T>.x").WithLocation(23, 18),
9027
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S3<T>.x").WithLocation(18, 18),
9030
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S0<T>.x").WithLocation(3, 18),
9033
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S2<T>.x").WithLocation(13, 18),
9036
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S5<T>.x").WithLocation(28, 18),
9039
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("S6<T>.x").WithLocation(32, 20));
9832
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "D").WithArguments("NS.E.D"),
9835
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "E").WithArguments("NS.E.E"),
9838
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("NS.E.F"),
9841
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Q").WithArguments("NS.R.Q"),
9844
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "R").WithArguments("NS.R.R"));
10811
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("x.cly.a").WithLocation(12, 13),
10817
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("x.cly.i").WithLocation(13, 13),
10829
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "a").WithArguments("x.cly.a").WithLocation(12, 13),
10832
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("x.cly.i").WithLocation(13, 13),
10935
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("NS.S.field")
11272
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("MainClass.i")
12250
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Field1").WithArguments("NS.Goo.SGoo.Field1"),
12326
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("TestClass.i")
12369
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C1<T>.f"),
12371
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C2<T>.f"),
12373
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C3<T>.f"),
12375
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C4<T>.f"),
12377
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C5<T>.f"));
12397
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("TestClass.i"));
12954
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("NS.Goo.i"),
12957
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "field").WithArguments("NS.Bar<T>.field"));
13421
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "X").WithArguments("NS.Test.X"),
13424
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Y").WithArguments("NS.Test.Y"),
13427
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Z").WithArguments("NS.Test.Z"));
14030
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "f").WithArguments("C.f").WithLocation(4, 17));
14462
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "myStaticField").WithArguments("NS.Test.myStaticField")
14922
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "F").WithArguments("B.F"));
15949
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Age").WithArguments("A.Age")
17490
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "i").WithArguments("A.i"),
17493
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "j").WithArguments("A.j"));
17593
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "cls").WithArguments("SA.Test.cls"));
19411
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_P").WithArguments("C.get_P"));
19497
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "A").WithArguments("C<A, B, D, E, F, G>.A"));
19561
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "T").WithArguments("N.S.T"),
19564
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "I").WithArguments("N.S.I")
19630
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "T").WithArguments("C.S.T"),
19633
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "I").WithArguments("C.S.I")
19674
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "add_E").WithArguments("C.add_E"),
19750
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Item").WithArguments("S.Item"),
19753
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "P").WithArguments("S.P"),
19756
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_Item").WithArguments("A.get_Item"),
19759
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "set_Item").WithArguments("A.set_Item"),
19762
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_Item").WithArguments("B.get_Item"),
19765
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_P").WithArguments("B.get_P"),
19790
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Item").WithArguments("A.Item"));
19798
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_Item").WithArguments("A.get_Item"));
19805
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "set_Item").WithArguments("A.set_Item"));
19833
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "P").WithArguments("A.P"));
19841
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_P").WithArguments("A.get_P"));
19848
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "set_P").WithArguments("A.set_P"));
19862
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "Item").WithArguments("A.Item"));
19866
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "get_Item").WithArguments("A.get_Item"));
19870
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "set_Item").WithArguments("A.set_Item"));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (18)
Diagnostics\DiagnosticTest.cs (1)
2909
case ErrorCode.
WRN_UnreferencedField
:
Parsing\FileModifierParsingTests.cs (5)
858
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.x").WithLocation(3, 14)
1061
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "file").WithArguments("C.file").WithLocation(3, 9)
1276
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "async").WithArguments("C.async").WithLocation(3, 10)
1362
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "item").WithArguments("C.item").WithLocation(3, 10)
2915
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)
3692
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("D.x").WithLocation(11, 7),
3698
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c").WithArguments("D.c").WithLocation(12, 7));
3842
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x1").WithArguments("D.x1").WithLocation(11, 7),
3848
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "c1").WithArguments("D.c1").WithLocation(12, 9));
Syntax\SyntaxFactoryTests.cs (2)
657
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.x").WithLocation(1, 34));
665
Diagnostic(ErrorCode.
WRN_UnreferencedField
, "x").WithArguments("C.x").WithLocation(1, 34));