www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5949] New: Mutable enum matrix rows


           Summary: Mutable enum matrix rows
           Product: D
           Version: unspecified
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc

--- Comment #0 from bearophile_hugs eml.cc 2011-05-07 16:08:46 PDT ---
This D2 code compiles and runs with no errors (DMD 2.053beta), but it's wrong:

void main() {
    enum int[][] data = [[1]];
    foreach (a; data)
    assert(data[0][0] == 1);
    foreach (ref a; data)
    assert(data[0][0] == 1);

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