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

--- Comment #0 from 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

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:
------- You are receiving this mail because: -------

Reply via email to