Open LukeOwlclaw opened 3 years ago
Version Used: VS2019 16.10.3 C:\Program Files\dotnet\sdk\5.0.302\Sdks\Microsoft.NET.Sdk\targets..\analyzers\Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll
Steps to Reproduce:
private int mTest = 5;
Program.cs
You'll see immediately: Message IDE0051 Private member 'Program.mTest' is unused
Message IDE0051 Private member 'Program.mTest' is unused
Main()
Console.WriteLine(nameof(Class1));
Actual Behavior:
Message IDE0051 is gone!
Expected Behavior:
Message IDE0051 should stay independent of nameof being used in file.
nameof
Screenshots: (for visualizing I set IDE0051 to "error" and used extension "Solution Error Visualizer"):
Same problem applies to IDE0052
The same problem happens when using the range operator ... For example write:
..
Console.WriteLine("Hello World!"[0..]);
And the IDE0051 error will disappear.
Version Used: VS2019 16.10.3 C:\Program Files\dotnet\sdk\5.0.302\Sdks\Microsoft.NET.Sdk\targets..\analyzers\Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll
Steps to Reproduce:
private int mTest = 5;
toProgram.cs
You'll see immediately:
Message IDE0051 Private member 'Program.mTest' is unused
Main()
:Console.WriteLine(nameof(Class1));
Actual Behavior:
Message IDE0051 is gone!
Expected Behavior:
Message IDE0051 should stay independent of
nameof
being used in file.Screenshots: (for visualizing I set IDE0051 to "error" and used extension "Solution Error Visualizer"):
Same problem applies to IDE0052