dotnet/roslyn

"Unused using" incorrectly reported in IDE

Open

#67,473 opened on 2023年3月23日

GitHub で見る
 (1 comment) (1 reaction) (0 assignees)C# (4,257 forks)batch import
Area-CompilersBugIDE-CodeStylehelp wanted

Repository metrics

Stars
 (20,414 stars)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

Using VS 17.6p3 and working on the compiler project at this commit: https://github.com/jcouv/roslyn/tree/unused-using-bug-67473

I open ExtensionTypeTests.cs and notice a greyed out using directive: image

But I remove this using, I get an error on line 5449 which uses VariableDeclaratorSyntax: image

I tried investigating whether the compiler is producing an incorrect HDN_UnusedUsingDirective hidden diagnostic, using a command-line build under debugger, but the hidden diagnostic was not produced. So I suspect there is some IDE issue, possibly with how the compilation is set up.

image

コントリビューターガイド