http://d.puremagic.com/issues/show_bug.cgi?id=6396

           Summary: enums + struct initializers == wrong code
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha <dsim...@yahoo.com> 2011-07-28 12:40:37 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to