Allow identical imports

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jul 30 08:49:23 PDT 2013


On Tue, Jul 30, 2013 at 04:58:34PM +0200, Timon Gehr wrote:
> On 07/30/2013 04:30 PM, Kenji Hara wrote:
[...]
> >Currently selective import *implicitly* creates alias declaration for
> >each picked up names, and two equivalent selective import will make
> >two alias declarations implicitly, then they conflict each other.
> >
> >import std.conv : to;
> >import std.conv : to;
> >
> >is mostly same as:
> >
> >import std.conv;
> >alias to = std.conv.to;
> >alias to = std.conv.to;  // conflict with the first alias
> >
> >I think it's a not good compiler implementation detail and
> >unnecessary intrusive behavior.
> >Now I'm proposing to fix import mechanism in here.
> >https://github.com/D-Programming-Language/dmd/pull/2256
> >
> >Kenji Hara
> 
> I think that the two alias declarations should simply not conflict.

If the two aliases are aliasing the same thing, then they shouldn't
conflict. This should be easy for the compiler to verify, right?


T

-- 
If Java had true garbage collection, most programs would delete themselves upon execution. -- Robert Sewell


More information about the Digitalmars-d mailing list