alias this on module

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri May 5 01:08:37 PDT 2017


On 5/5/17 3:37 AM, Meta wrote:
>     //What?
>     Test.testfun1(); Error: no property 'testfun1' for type
> 'test2.Test', did you mean 'testfun1'?
> }
>
> If you add this alias to Test then it will work as expected:
>
> alias testfun1 = test3.testfun1;

Yeah, I'm not sure public importing inside a class/struct is intended to 
do what you expect. The spec says "All symbols from a publicly imported 
module are also aliased in the importing module". But it doesn't say 
anything explicitly about public importing inside a class/struct.

-Steve


More information about the Digitalmars-d mailing list