Skip to content
Browse files

Test sink/method call/die interaction bug.

  • Loading branch information...
1 parent f493956 commit fa9e6b744de890480e764d4194b65ac3eb3a45d1 @jnthn jnthn committed
Showing with 11 additions and 1 deletion.
  1. +11 −1 S04-statements/for.t
View
12 S04-statements/for.t
@@ -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">
@@ -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.
Something went wrong with that request. Please try again.