Bug 17357 – DMD wrongly considers template instance class as nested

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-04-28T15:02:31Z
Last change time
2024-12-13T18:52:05Z
Assigned to
No Owner
Creator
Puneet Goel
Moved to GitHub: dmd#19248 →

Comments

Comment #0 by puneet — 2017-04-28T15:02:31Z
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; }
Comment #1 by robert.schadek — 2024-12-13T18:52:05Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19248 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB