[Issue 3427] New: Chain doesn't work w/ arrays with immutable elements.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 20 14:03:14 PDT 2009


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

           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
        AssignedTo: nobody at puremagic.com
        ReportedBy: dsimcha at yahoo.com


--- Comment #0 from David Simcha <dsimcha at yahoo.com> 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
std.range:

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

-- 
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