Bug 8117 – Cannot initialize struct member without default constructor

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-18T17:02:00Z
Last change time
2013-11-30T09:09:43Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
wfunction

Comments

Comment #0 by wfunction — 2012-05-18T17:02:05Z
struct S { @disable this(); this(int) { } } class T { S s = S(1); } void main() { new T(); } Error: default construction is disabled for type T ^ wat? Why is it looking for a default constructor?
Comment #1 by wfunction — 2012-05-18T17:05:39Z
Comment #2 by simen.kjaras — 2012-07-27T15:38:31Z
*** This issue has been marked as a duplicate of issue 7121 ***
Comment #3 by k.hara.pg — 2013-11-28T21:09:09Z
(In reply to comment #2) > *** This issue has been marked as a duplicate of issue 7121 *** Still not work with 2.064. https://github.com/D-Programming-Language/dmd/pull/2899
Comment #4 by github-bugzilla — 2013-11-30T05:01:37Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2e68cfe3162bbdad8ab9545b4ddf3f9c8c27d693 fix Issue 8117 - Cannot initialize struct member without default constructor https://github.com/D-Programming-Language/dmd/commit/c64f07b210e308e8b0b99516d247ff189e3342a4 Merge pull request #2899 from 9rnsr/fix8117 Issue 8117 - Cannot initialize struct member without default constructor