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

           Summary: array() of iterable of immutable items
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-02-20 15:01:52 PST ---
A D2 program:


import std.algorithm: map;
import std.array: array;
void main() {
    auto r = map!q{ "A"[0] }([0, 1, 2]);
    auto a = array(r); // Error: result[i] isn't mutable
    assert(a == "AAA");
}


DMD 2.052 gives the errors:
...\dmd\src\phobos\std\array.d(62): Error: result[i] isn't mutable
test.d(5): Error: template instance std.array.array!(Map!(result,int[])) error
instantiating


In my opinion array() needs to be able to build an array of immutable items
too, like a string from its immutable chars.

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

Reply via email to