Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
RT #102650: scoping bug in statement-modifying for-loops
  • Loading branch information
moritz committed Jan 12, 2013
1 parent aedecf7 commit b1cba00
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion S04-declarations/my.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 71;
plan 72;

#L<S04/The Relationship of Blocks and Declarations/"declarations, all
# lexically scoped declarations are visible">
Expand Down Expand Up @@ -290,4 +290,16 @@ eval_lives_ok 'multi f(@a) { }; multi f(*@a) { }; f(my @a = (1, 2, 3))',
nok $bad, '... and it does so before run time';
}

#RT #102650
{
my @tracker;
my $outer;
sub t() {
my $inner = $outer++;
@tracker.push($inner) and t() for $inner ?? () !! ^2;
}
t();
is @tracker.join(', '), '0, 0', 'RT 102650';
}

# vim: ft=perl6

0 comments on commit b1cba00

Please sign in to comment.