Bug 20442 – Please add a warning that will complain about unused imports
Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-12-11T03:18:41Z
Last change time
2019-12-11T12:25:01Z
Assigned to
No Owner
Creator
Manu
Comments
Comment #0 by turkeyman — 2019-12-11T03:18:41Z
Please add an optional warning that will complain about unused imports.
I think this could be added to `-w`/`-wi`.
We want to have a warning that helps us find and clean up unused imports. It should be trivial to keep a flag against import statements during symbol lookup?
Comment #1 by razvan.nitu1305 — 2019-12-11T11:39:30Z
This has come up in the past and the typical answer was: "This should be implemented as a third party tool using dmd as a library".
Comment #2 by turkeyman — 2019-12-11T11:57:49Z
That's a shit solution.
Build systems are way complex enough, and a whole other pass to make a trivial warning is silly when we already have a perfectly good warning solution; `-w`
Comment #3 by greeenify — 2019-12-11T12:25:01Z
Yes, Walter consistently rejected such proposals. Before this can be tracked as an issue, it needs to get approval from either Atila or Walter, but as Razvan mentioned there are many precedents for rejections, I sadly have to close this as WONTFIX.