Bug 14676 – Calling the constructor of the parent class of an anonymous class

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-06-10T15:09:00Z
Last change time
2015-06-10T23:30:19Z
Assigned to
nobody
Creator
sigurdbergsvela

Comments

Comment #0 by sigurdbergsvela — 2015-06-10T15:09:21Z
As an enhancement; the ability to call the constructor of the parent class when creating an anonymous class. class A { this(int param) { } } A anonymous = new class A(12) {} ^ ^
Comment #1 by dlang-bugzilla — 2015-06-10T23:30:19Z
Just add a constructor to your nested class, as per your SO question: http://stackoverflow.com/a/30758896/21501 If still you think this is a language addition worth considering, please submit a DIP: http://wiki.dlang.org/DIPs