DMD 2.071.1 and Issue 15925 - [REG 2.071] Import declaration from mixin templates are ignored

captaindet via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 30 05:20:26 PDT 2016


> Author here. I originally thought the issue was that an 'imported' scope
> imports are not considered anymore.

this is exactly what i was/am afraid of ...[see below]

> As Walter explained in this issue and in
> https://issues.dlang.org/show_bug.cgi?id=15966 this behaviour changed to
> prevent hijacking and is intended.

15966 is about "protected" and the very example in 15925 uses a 
protected import too. not sure about the protected story. the scary 
thing is that the example in issue 15925 also fails to work if it is a 
public import inside the mixin template. does this mean mixin templates 
now have no way of adding imports to the scope they are mixed in? this 
is really bad news for meta programming. i would have to do this with 
ugly string mixins from now on, or is this unintended behavior for 
string mixins as well?

or is all this a special case for classes? how about at module level? 
where is all this mentioned in the specs?

this leaves me quite confused.


More information about the Digitalmars-d mailing list