masking of module-level functions with local imports

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 15 07:13:34 PDT 2015


On 10/8/15 11:52 PM, Steven Schveighoffer wrote:

> Another *horrendous* issue I have seen:
>
> a.d:
> module a;
> void foo(int) {}
>
> main.d:
>
> void foo(string) {}
> void main()
> {
>     import main; // yes, you have to import main inside main
>     import a;
>     foo("hi");
> }
>
> Can we fix this?

Nobody else finds this to be an issue? Should we just close bugs like 
15179 with "sorry, please import everything you need local or global, 
too bad the phobos/druntime changes broke your code"?

-Steve


More information about the Digitalmars-d mailing list