[Issue 15179] Local imports cause outer imports to be excluded from overload set

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Mar 24 18:04:14 PDT 2016


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

--- Comment #6 from Jesse Phillips <Jesse.K.Phillips+D at gmail.com> ---
(In reply to Steven Schveighoffer from comment #5)
> In any case, the solution here is to do a selective import in a scope, which
> works as expected. Alternatively, you can import both modules at the same
> scope so they are used at the same priority.

That doesn't solve the highjacking, Walter has made a big point about D's
anti-highjacking feature.

> But in the final version, I would expect foo's foobar overload set to be prioritized, because it was imported locally and has priority.

I would not, this would be a huge hole in D's anti-highjacking features. I
would expect local imports to be included in the lookup set just as global
imports. Only would an alias create the priority, just as global imports.

--


More information about the Digitalmars-d-bugs mailing list