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

           Summary: Ignored immutable in struct literal
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from [email protected] 2013-03-04 17:23:22 PST ---
Issue found by Ali �ehreli:
http://forum.dlang.org/thread/[email protected]

DMD 2.063alpha accepts this code, ignoring the immutable():


struct Foo {
    int[] arr;
    this(int[] arr_) {
        this.arr = arr_;
    }
}
void main() {
    auto arr = [1];
    auto f = immutable(Foo)(arr);
    pragma(msg, typeof(f)); // Prints: Foo
    f.arr[0]++;
}

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

Reply via email to