Compiler doesn't warn for declared but unused variables
Mindy Batek (0xEAB)
desisma at heidel.beer
Sat Nov 28 16:02:02 UTC 2026
On Friday, 27 November 2026 at 19:51:57 UTC, Kapendev wrote:
> On Friday, 27 November 2026 at 16:34:07 UTC, DLearner wrote:
>> It's not an error, but should it not generate a warning?
>
> No idea what linters exist for D, but they can do a better job
> than a compiler for things like this. Scope the warnings,
> change how strict they need to be, ...
D-Scanner can be used to check for unused variables:
<https://github.com/dlang-community/D-Scanner#implemented-checks>
More information about the Digitalmars-d-learn
mailing list