Fixed (for now at least) with 9b6f2eb5434e71f07bc649 . Tests still needed.
> On 18 Sep 2016, at 19:30, Sam S. (via RT) <perl6-bugs-follo...@perl.org> > wrote: > > # New Ticket Created by Sam S. > # Please include the string: [perl #129299] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=129299 > > > > When a quantified capture group matched zero times but the overall regex > matches, then the List returned from `$/.list` stops iterating before the > corresponding element: > > "ac" ~~ / (a) (b)? (c) /; > say ($0, $1, $2); # (「a」 Nil 「c」) > say $/.list; # (「a」) > say $/.list.map({1}); # (1) > say $/.list.elems; # 3 > say $/.list[0, 1, 2, 3]; # (「a」 (Mu) 「c」 Nil > > Expected behavior would be for `$/.list;` to return `(「a」 Nil 「c」)`. > > mst++ suggested that maybe an InterationEnd is ending up where it shouldn't > be.