www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2850] New: bad codegen for struct static initializers

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

           Summary: bad codegen for struct static initializers
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: clugdbug yahoo.com.au


This assert fails at runtime. The initialization doesn't happen.
Struct literals work. Also "enum Test test = { 714 }; " works.

-----
struct Test{
 int foo;
}

enum Test test = { foo:714 };

void main(){
assert(test.foo == 714);
}


-- 
Apr 17 2009