dotnet/roslyn

"Unused using" incorrectly reported in IDE

Open

#67.473 aberto em 23 de mar. de 2023

Ver no GitHub
 (1 comment) (1 reaction) (0 assignees)C# (4.257 forks)batch import
Area-CompilersBugIDE-CodeStylehelp wanted

Métricas do repositório

Stars
 (20.414 stars)
Métricas de merge de PR
 (Mesclagem média 6d 17h) (256 fundiu PRs em 30d)

Description

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

Guia do colaborador