On Saturday, December 24, 2016 15:32:58 Andrei Alexandrescu via Digitalmars-
d 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?

I say leave it be. It's the sort of thing that risks causing problems with
conditional compilation (not as bad as in some cases, but I still don't
think that it's worth the risk). IMHO, this is the sort of thing that should
be left up to a lint tool, and there's technically nothing wrong with it.

- Jonathan M Davis

Reply via email to