Bug 12981 – Can't refer to 'outer' from mixin template
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-06-24T11:40:00Z
Last change time
2014-06-29T20:43:31Z
Keywords
industry, pull
Assigned to
nobody
Creator
public
Comments
Comment #0 by public — 2014-06-24T11:40:56Z
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.