[dmd-internals] Why are there suddenly tons of deprecation messages about imports in Phobos?

Steven Schveighoffer via dmd-internals dmd-internals at puremagic.com
Mon Feb 22 06:59:31 PST 2016


> On Feb 22, 2016, at 7:04 AM, Jonathan M Davis via dmd-internals <dmd-internals at puremagic.com> wrote:
> 
> On Sunday, February 21, 2016 19:08:37 Steven Schveighoffer via dmd-internals wrote:
>> 
>> The key comment in those PRs: https://github.com/D-Programming-Language/dmd/pull/5426#issuecomment-181589047
> 
> Well, while I can see why from an implementation perspective, it makes sense
> to say that when you have
> 
> import foo.bar : baz;
> 
> you haven't really imported the module, so foo.bar.baz isn't legit, and you
> have to say baz, from a usability perspective, nobody is going to expect
> that foo.bar.baz suddenly is just baz and not foo.bar.baz, because you
> imported it with a selective imports.

Like the comment says, however, what if you have a local foo symbol defined? The compiler is going to complain, or silently choose one (I think with the new lookup rules, it would choose the local module’s name).

With Phobos, this isn’t strictly an issue, since we have no local symbols named std. But I could see lots of problems with other libraries.

-Steve


More information about the dmd-internals mailing list