www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19850] New: double nested joiner .back falsely thinks the

https://issues.dlang.org/show_bug.cgi?id=19850

          Issue ID: 19850
           Summary: double nested joiner .back falsely thinks the range is
                    empty
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: default_357-line yahoo.de

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:
core.exception.AssertError dmd-2.085.1/linux/bin64/../../src/phobos/std/algorithm/iteration.d(567):
Attempting to fetch the back of an empty map.

--
May 06 2019