Nested public imports - bug or feature?
Dicebot via Digitalmars-d
digitalmars-d at puremagic.com
Thu Aug 13 08:34:05 PDT 2015
On Thursday, 13 August 2015 at 13:56:24 UTC, Timon Gehr wrote:
> It has nothing to do with the import being public. This works:
>
> ---
> struct Std{
> import std.stdio;
> }
> void main(){
> Std.writeln("Nice!");
> }
> ---
>
> (It also works if main and Std are defined in different
> modules.)
Ah, I thought alias injection is only done for public ones. Same
question applies though :)
> In any case, I guess we agree that this idiom should work for
> public imports, but not for non-public ones (so the current
> behaviour with non-public imports is accepts-invalid, but
> Dicebot's code should be fine)?
I am very curious to learn "official" answer :)
More information about the Digitalmars-d
mailing list