Nested public imports - bug or feature?

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 13 09:18:30 PDT 2015


On Thursday, 13 August 2015 at 15:53:16 UTC, anonymous wrote:
> On Thursday, 13 August 2015 at 15:29:19 UTC, Dicebot wrote:
>> struct Something
>> {
>>     public import a;
>> }
>>
>> void main() { Something.foo(); }
>
> What's wrong with `import Something = a;`? Bugs?

Works only with a single import:

import mypkg = mypkg.mysubpkg.mod1;
import mypkg = mypkg.mysubpkg.mod2; // error, can't redefine 
aliased import!

struct mypkg
{
     import mypkg.mysubpkg.mod1;
     import mypkg.mysubpkg.mod2; // fine
}


More information about the Digitalmars-d mailing list