Preliminary fix for 2016.12 made in 7021861705f03b105d . Proper fix will happen after the release. Tests are still needed.
> On 16 Dec 2016, at 23:43, Aleks-Daniel Jakimenko-Aleksejev (via RT) > <perl6-bugs-follo...@perl.org> wrote: > > # New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev > # Please include the string: [perl #130365] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=130365 > > > > From outdated design docs: > “Note that grep is an implicit loop, so next and last without an argument > will iterate or terminate the grep itself, not some loop surrounding the > statement containing the grep” > > OK, so 「last」 in grep is supposed to work. And it did… > > Code: > say (^Inf).grep({last if $_ > 5; True})[^20] > > Result (2016.02): > (0 1 2 3 4 5 Nil Nil Nil Nil Nil Nil Nil Nil Nil Nil Nil Nil Nil Nil) > > Result (HEAD): > (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19) > > > Bisectable points to > https://github.com/rakudo/rakudo/commit/6d120cab6d0bf55a3c96fd3bd9c2e841e7eb99b0