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.
Comment #1 by k.hara.pg — 2014-06-29T02:45:26Z
Comment #2 by github-bugzilla — 2014-06-29T20:43:30Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/394a58a084386613e19636e84a4cfc024e224b2d fix Issue 12981 - Can't refer to 'outer' from mixin template https://github.com/D-Programming-Language/dmd/commit/59f088f2c52c9aa5bf67e9581450a984b27cb876 Merge pull request #3700 from 9rnsr/fix12981 [REG2.008] Issue 12981 - Can't refer to 'outer' from mixin template