Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test sink/method call/die interaction bug.
  • Loading branch information
jnthn committed Jan 10, 2013
1 parent f493956 commit fa9e6b7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S04-statements/for.t
Expand Up @@ -14,7 +14,7 @@ for statement as possible
=end description

plan 75;
plan 76;

## No foreach
# L<S04/The C<for> statement/"no foreach statement any more">
Expand Down Expand Up @@ -563,4 +563,14 @@ lives_ok {
is $c, 0, '... and $_ is *always* read-only here';
}

dies_ok
{
my class Foo {
has @.items;
method check_items { for @.items -> $item { die "bad" if $item == 2 } }
method foo { self.check_items; .say for @.items }
}
Foo.new(items => (1, 2, 3, 4)).foo
}, 'for in called method runs (was a sink context bug)';

# vim: ft=perl6

0 comments on commit fa9e6b7

Please sign in to comment.