< bartolin_> r: my $str; my $i = 0; while $i < 2 { LEAVE { last }; $i++; $str 
~= ~$i; }; say $str; $str = ""; $i = 0; while $i < 2 { LEAVE { $str ~= 
"leaving" }; $i++; $str ~= ~$i; }; say $str
<+camelia>   rakudo-moar a38b59: OUTPUT«1␤1leaving2leaving␤»
<+camelia>   ..rakudo-jvm a38b59: OUTPUT«1␤␤»
< bartolin_> [Coke]: ^^ alas, there still seems to be something wrong on JVM 
with RT #121145
< [Coke]>    bartolin_: hokay.
< [Coke]>    We can at least add a test and make sure we don't regress on moar 
- don't have to get JVM 100% before christmas.
< bartolin_> [Coke]: I'll add a test for that ... what you said

Test was added to S04-phasers/in-loop.t with commit 
https://github.com/perl6/roast/commit/7ce647a18a

The strange thing is, that the second while loop (which fails on JVM, see 
above) works as expected if executed "stand alone":

$ perl6-j -e 'my $str = ""; my $i = 0; while $i < 2 { LEAVE { $str ~= "leaving" 
}; $i++; $str ~= ~$i; }; say $str'
1leaving2leaving


Reply via email to