[Issue 24778] Warning for unused imports

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 24 13:01:37 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24778

--- Comment #9 from RazvanN <razvan.nitu1305 at gmail.com> ---
(In reply to basile-z from comment #8)
> RazvanN: I dont like how it's implemented.
> 
> I remember I already suggested that in a forum discussion but, let's do it
> again:
> 
> If it's implemented in the compiler it would be better to implements this as
> a "touched" system. You see when searching a symbol has worked and via an
> import, you flag that import as "touched".
> 
> Then when the user asks for unused import you visit the tree and when it's
> an import node and that import has not been touched you emit the warning.

I am fully aware how to implement it. In fact you can see that my
implementation does the same thing, however, in dmdlib you do not have all the
information that the compiler does (yet, I hope).

--


More information about the Digitalmars-d-bugs mailing list