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

--- Comment #20 from Steven Schveighoffer <[email protected]> ---
(In reply to Ketmar Dark from comment #19)
> ah, i see, thank you. i really misread the suggesion. still, i like Kenji's
> PR4915 more. ;-) i'd better see "shadowing error", so i can simply rename
> symbols, and don't guess if there is conflict or not.

Yes, thank you Timon for explaining better.

The main reason I see local imports being useful is this:

import somemodule;

void foo()
{
   onlyPlaceSomeModuleIsUsed()
}

Now, one can simply say "wait, somemodule isn't something everyone in the file
needs, just foo. I'll move it inside"

And then it breaks. I'd rather just see it work the same. All you are doing is
saying who has access to somemodule's symbols, and avoid polluting the module
namespace.

--

Reply via email to