[Issue 16442] New: FrontTransversal fails with empty ranges

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Aug 28 08:34:29 PDT 2016


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

          Issue ID: 16442
           Summary: FrontTransversal fails with empty ranges
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: gruen_tobias at web.de

If the input ROR of FrontTransversal consists of empty ranges
and the option assumeNotJagged || enforceNotJagged is set, the return value of
empty is wrong.

=== 
int[][] arr = [[], []];

auto ft = frontTransversal!(TransverseOptions.assumeNotJagged)(arr);

foreach(elem; ft) // fails here.. 
{

}

===
Will Throw a
core.exception.AssertError:"Attempting to fetch the front of an empty array of
int"

--


More information about the Digitalmars-d-bugs mailing list