[Issue 10378] Local imports hide local symbols

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jan 19 14:30:55 PST 2016


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

--- Comment #18 from timon.gehr at gmx.ch ---
(In reply to Ketmar Dark from comment #17)
> this will pollute module scope with imported symbols.
> 
> imagine that i have `mymodule.foo (float v)` function, and defined local
> `foo (int v)` function. with your "hidden global import" whenever i'll
> import "mymodule", it will add unexpected `foo` overload for the whole code.
> 
> also, it breaks "module importing orger doesn't matter" rule.


Those statements are all incorrect, so maybe you misunderstood the suggestion.
The suggestion is that name lookup should behave as if the set of global
imports considered depended on the local scope. The net effect is that imports
never hide each other, but symbols of the current module always hide imported
symbols.

--


More information about the Digitalmars-d-bugs mailing list