[Issue 17357] New: DMD wrongly considers template instance class as nested
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Apr 28 08:02:31 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17357
Issue ID: 17357
Summary: DMD wrongly considers template instance class as
nested
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: puneet at coverify.org
When compiled with github HEAD, I get:
test.d(6): Error: outer class Foo 'this' needed to 'new' nested class Frop
For now the workaround is to declare Frop static.
// static
class Frop(alias t) { }
void build(G)(G g) {
alias E = typeof(g.tupleof[0]);
g.tupleof[0] = new E;
}
class Tx {
class Foo {
Frop!a cp_a;
int a;
}
Foo bar;
this() { bar = new Foo; }
}
void main() {
Tx tx ;
tx = new Tx;
tx.bar.build;
}
--
More information about the Digitalmars-d-bugs
mailing list