[Issue 12981] New: Can't refer to 'outer' from mixin template
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Tue Jun 24 04:40:56 PDT 2014
    
    
  
https://issues.dlang.org/show_bug.cgi?id=12981
          Issue ID: 12981
           Summary: Can't refer to 'outer' from mixin template
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: public at dicebot.lv
This code works in D1 (and prints "B" as expected):
=======
template AAA(T)
{
    class A
    {
        alias typeof(this.outer) x;
    }
}
class B
{
    mixin AAA!(int);
    pragma(msg, A.x);
}
void main() {}
=======
With current git master:
a.d(3): Error: variable this forward referenced
a.d(11): Error: mixin a.B.AAA!int error instantiating
a.d(13):        while evaluating pragma(msg, A.x)
I don't know at which point it stopped working in D2. It has been found during
porting of some of Sociomantic code.
--
    
    
More information about the Digitalmars-d-bugs
mailing list