Allow identical imports

Timon Gehr timon.gehr at gmx.ch
Tue Jul 30 07:58:34 PDT 2013


On 07/30/2013 04:30 PM, Kenji Hara wrote:
> 2013/7/30 Dicebot <public at dicebot.lv <mailto:public at dicebot.lv>>
>
>     On Tuesday, 30 July 2013 at 12:29:00 UTC, Daniel Murphy wrote:
>
>         Please file a bug report: http://d.puremagic.com/issues/
>
>
>     I don't think it is a bug, enhancement request for error message at
>     most.
>
>
> 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.


More information about the Digitalmars-d mailing list