Bug 6299 – Auto constructor for heap structs too

Status
RESOLVED
Resolution
WORKSFORME
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-07-12T11:55:00Z
Last change time
2014-03-19T18:57:08Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-07-12T11:55:14Z
Regarding "Removing limitations", I'd like this to compile with no need to write a constructor: struct Foo { int x; } void main() { auto f = new Foo(1); } In DMD 2.054 this gives: test.d(3): Error: no constructor for Foo
Comment #1 by lt.infiltrator — 2014-03-19T18:57:08Z
This works as of v2.065.