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


[21:26] <TimToady> m: sub f($x) { my $z; do $z while ++$z < $x }; say f(5)
[21:26] <+camelia> rakudo-moar 6471e8: OUTPUT«Cannot call prefix:<++>(Any); 
none of these signatures match:␤    (Mu:D $a is rw)␤    (Mu:U $a is rw)␤    
(Int:D $a is rw)␤    (int $a is rw)␤    (Bool $a is rw)␤    (Num:D $a is rw)␤   
 (Num:U $a is rw)␤    (num $a is rw)␤  in block <uni…»
[21:26] <ab6tract> m: ++(my $f)
[21:26] <+camelia> rakudo-moar 6471e8: ( no output )
[21:26] <TimToady> m: sub f($x) { my $z; return do $z while ++$z < $x }; say 
f(5)
[21:26] <+camelia> rakudo-moar 6471e8: OUTPUT«(5 5 5 5)␤»
[21:26] == cpage_ [~cpage@17.114.4.52] has quit [Quit: cpage_]
[21:27] <TimToady> m: sub f($x) { my $z; return (while ++$z < $x { $z }) }; say 
f(5)
[21:27] <+camelia> rakudo-moar 6471e8: OUTPUT«(5 5 5 5)␤»
[21:27] <TimToady> works with explicit return, anyway
[21:27] <TimToady> so at least there's a workaround

Reply via email to