[DIP1005] Unused imports in with(import) declarations: leave alone of flag as errors?

rikki cattermole via Digitalmars-d digitalmars-d at puremagic.com
Sat Dec 24 14:38:27 PST 2016


On 25/12/2016 9:32 AM, Andrei Alexandrescu wrote:
> Consider:
>
> with (import std.stdio)
> int fun(int x/*, File f*/)
> {
>     // f.writeln("In: ", x);
>     return x * x;
> }
>
> Such situations occur during refactorings and code evolution. The import
> is no longer used. Should the compiler flag that as an error, or leave
> it be?
>
>
> Andrei

How costly is the checking of if said import is used?


More information about the Digitalmars-d mailing list