Bug 13621 – inout issue with std.container.Array opSlice

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-10-15T20:19:00Z
Last change time
2014-11-01T11:42:51Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
code
Blocks
13640

Comments

Comment #0 by code — 2014-10-15T20:19:58Z
cat > bug.d << CODE import std.container : Array, BinaryHeap; alias Heap = BinaryHeap!(Array!int); CODE dmd -c bug ---- /home/dawg/Code/D/DPL/dmd/src/../../phobos/std/container/array.d(432): Error: cannot implicitly convert expression ((inout inout(Range) __ctmp1781 = 0; , __ctmp1781).this(this, 0LU, this.length())) of type inout(Range) to Range bug.d(2): while looking for match for BinaryHeap!(Array!int) ---- Introduced with https://github.com/D-Programming-Language/phobos/pull/2573.
Comment #1 by code — 2014-10-27T18:45:23Z
Temporary workaround is to change Range opSlice() inout to inout(Range) opSlice() inout https://github.com/D-Programming-Language/phobos/blob/bf37eef3bd7f2eb643971d9bdfdeb00f67068697/std/container/array.d#L430 and Range opSlice(size_t i, size_t j) inout to inout(Range) opSlice(size_t i, size_t j) inout https://github.com/D-Programming-Language/phobos/blob/bf37eef3bd7f2eb643971d9bdfdeb00f67068697/std/container/array.d#L443
Comment #2 by k.hara.pg — 2014-11-01T11:42:51Z
(In reply to Martin Nowak from comment #0) > Introduced with https://github.com/D-Programming-Language/phobos/pull/2573. The PR was reverted by: https://github.com/D-Programming-Language/phobos/pull/2643 And the issue is fixed in git-head.