Bug 6396 – enums + struct initializers == wrong code

Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-07-28T12:40:00Z
Last change time
2012-05-29T00:59:48Z
Keywords
wrong-code
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2011-07-28T12:40:37Z
struct S { bool b; double d = 3.14159265; int i = 42; } enum S s = {b : true}; void main() { import std.stdio; writeln(s.d); // nan writeln(s.i); // 0 } Changing the enum to immutable fixes this.
Comment #1 by lovelydear — 2012-04-26T09:49:41Z
Still not working on 2.059 Is this even supposed to compile ?
Comment #2 by clugdbug — 2012-05-29T00:59:48Z
*** This issue has been marked as a duplicate of issue 4967 ***