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

           Summary: [CTFE] inplace array change
           Product: D
           Version: future
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-04-03 07:59:17 PDT ---
This D2 code asserts with dmd 2.042:


void foo(int[] ra) {
    ra[0] = 20;
}
int[] bar() {
    int[] data = [10];
    foo(data);
    return data;
}
void main() {
    int[] r1 = bar();
    assert(r1[0] == 20);
    enum int[] r2 = bar();
    assert(r2[0] == 20); // Assertion failure
}


This is quite important, because it introduces silent bugs.
It can be related to bug 1330.

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

Reply via email to