Bug 19850 – double nested joiner .back falsely thinks the range is empty
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-05-06T16:55:04Z
Last change time
2019-05-07T13:04:36Z
Keywords
pull
Assigned to
No Owner
Creator
FeepingCreature
Comments
Comment #0 by default_357-line — 2019-05-06T16:55:04Z
Consider the following code:
auto outer = [[[0]]];
auto result = outer.map!(
middle => middle.map!(
inner => inner.map!(
i => 0
)
).joiner
).joiner.back;
Expected: result == 0
Got: [email protected]/linux/bin64/../../src/phobos/std/algorithm/iteration.d(567): Attempting to fetch the back of an empty map.
Comment #1 by default_357-line — 2019-05-07T09:06:51Z
Shorter repro: [[[0]]].map!joiner.joiner.back;
Comment #2 by dlang-bot — 2019-05-07T11:26:08Z
@Spoov created dlang/phobos pull request #6995 "Fix Issue 19850 - double nested joiner .back falsely thinks the range…" fixing this issue:
- Fix Issue 19850 - double nested joiner .back falsely thinks the range is empty
https://github.com/dlang/phobos/pull/6995
Comment #3 by dlang-bot — 2019-05-07T13:04:36Z
dlang/phobos pull request #6995 "Fix Issue 19850 - double nested joiner .back falsely thinks the range…" was merged into stable:
- 46a35b902882df5abcd2320c410dab692366cce5 by Spoov:
Fix Issue 19850 - double nested joiner .back falsely thinks the range is empty
https://github.com/dlang/phobos/pull/6995