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

           Summary: enum doesn't work properly for invariant arrays
           Product: D
           Version: 2.022
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzi...@digitalmars.com
        ReportedBy: 2kor...@gmail.com


void foo(int offset)
{
    enum i1 = [1, 2, 3];
    invariant(int[]) i2 = [1, 2, 3];


    writefln(i1[offset]); // prints garbage
    writefln(i2[offset]); // prints valid value
}

foo(0);

Test run result:
-------
4315632
1


-- 

Reply via email to