# New Ticket Created by  Elizabeth Mattijsen 
# Please include the string:  [perl #125488]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=125488 >


[12:35:07]  <lizmat>    m: for ^2 { NEXT .say }  # feels like a rakudobug
[12:35:07]  <+camelia>  rakudo-moar a15dac: OUTPUT«Cannot call method 'say' on 
a null object␤  in block <unit> at /tmp/gV2l9tWyYZ:1␤␤»
[12:35:32]  <lizmat>    m: for ^2 { NEXT $_.say }  # same
[12:35:32]  <+camelia>  rakudo-moar a15dac: OUTPUT«Cannot call method 'say' on 
a null object␤  in block <unit> at /tmp/2JExRjB36d:1␤␤»
[12:35:45]  <lizmat>    m: for ^2 { .say }  # ok
[12:35:46]  <+camelia>  rakudo-moar a15dac: OUTPUT«0␤1␤»
[12:35:54]  <lizmat>    moritz: agree ?
[12:37:49]  <moritz>    lizmat: yes

Same for LAST:

$ 6 'for ^10 { LAST .say }'
Cannot call method 'say' on a null object

Not for FIRST, LEAVE, PRE, UNDO
$ 6 'for ^1 { FIRST .say }'
0
$ 6 'for ^1 { LEAVE .say }'
0
$ 6 'for ^1 { PRE .say }’
0
$ 6 'for ^1 { UNDO .say }’
0
$ 6 'for ^1 { KEEP .say; 1 }’
0

POST has a different failure mode:

$ 6 'for ^1 { POST .say }’
Nil


Liz

Reply via email to