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

           Summary: Hole in Const System:  popFront()
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha <dsim...@yahoo.com> 2010-09-16 17:38:03 PDT ---
Apparently using ref array parameters/implicit conversions gets around const in
this example.

void popFront(T)(ref T[] arr) {
    arr = arr[1..$];
}

void main() {
    immutable arr = [1,2,3,4,5].idup;
    arr.popFront();
    assert(arr == [2,3,4,5]);  // PASSES
}

Please take your time fixing this, though, as much of std.range relies on this
bug to work correctly with const/immutable arrays.

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

Reply via email to