Skip to content

Commit 2ab4fd0

Browse files
committed
tests incorrectly assume loop returns values
Loops at statementlist level should always sink themselves. The 'loop' statement was doing this incorrectly, so we didn't notice these tests were wrong.
1 parent 2eda05f commit 2ab4fd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

S04-statements/while.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ lives-ok { EVAL 'while 0 { my $_ }' }, 'Can declare $_ in a loop body';
160160

161161
# RT #127069
162162
{
163-
is { loop (my int $i = 0; $i < 10; $i++) { +$i } }(), '0 1 2 3 4 5 6 7 8 9', "can return ints from loop at end of immediate block";
164-
is { loop (my Int $i = 0; $i < 10; $i++) { +$i } }(), '0 1 2 3 4 5 6 7 8 9', "can return Ints from loop at end of immediate block";
163+
is { (loop (my int $i = 0; $i < 10; $i++) { +$i }) }(), '0 1 2 3 4 5 6 7 8 9', "can return ints from loop at end of immediate block";
164+
is { (loop (my Int $i = 0; $i < 10; $i++) { +$i }) }(), '0 1 2 3 4 5 6 7 8 9', "can return Ints from loop at end of immediate block";
165165
}
166166

167167
# vim: ft=perl6

0 commit comments

Comments
 (0)