[Issue 9656] New: Built-in dup result should behave as like unique array, if it is possible.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 6 01:17:33 PST 2013


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

           Summary: Built-in dup result should behave as like unique
                    array, if it is possible.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-03-06 01:17:32 PST ---
In below, narr = [1,2,3].dup should work.

class C {}
struct S {
    immutable int[] narr;
    immutable C[] carr;
    this(int n) {
        narr = new int[](3); // OK, expected
        narr = [1,2,3].dup;  // NG, rejects-valid
        carr = [new C].dup;  // NG, expected
    }
}

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


More information about the Digitalmars-d-bugs mailing list