Summary: Chain doesn't work w/ arrays with immutable elements.
           Product: D
           Version: 2.035
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: patch
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from David Simcha <> 2009-10-20 14:03:13 PDT ---
import std.range;

void main() {
    string a = "foo";
    string b = "bar";
    auto myChain = chain(a, b);

C:\dmd2\windows\bin\..\..\src\phobos\std\range.d(937): Error:
this._input._field_field_0[index] isn't mutable
C:\dmd2\windows\bin\..\..\src\phobos\std\range.d(937): Error:
this._input._field_field_1[index] isn't mutable

The fix is to test for immutability in the static if statement on line 930 of

static if (allSameType && is(typeof(_input.field[0][0] = ElementType.init)))

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to