Permalink
Browse files

test for RT #77460

  • Loading branch information...
1 parent 937565b commit 7bcdd2bf9b4ccb7c6cde00aec8b5d66ba6bc8822 @timo timo committed Feb 28, 2013
Showing with 11 additions and 1 deletion.
  1. +11 −1 S04-statements/for.t
View
@@ -14,7 +14,7 @@ for statement as possible
=end description
-plan 76;
+plan 77;
## No foreach
# L<S04/The C<for> statement/"no foreach statement any more">
@@ -573,4 +573,14 @@ dies_ok
Foo.new(items => (1, 2, 3, 4)).foo
}, 'for in called method runs (was a sink context bug)';
+# RT #77460
+{
+ my @a = 1;
+ for 1..10 {
+ my $last = @a[*-1];
+ push @a, (sub ($s) { $s + 1 })($last)
+ };
+ is @a, [1, 2, 3, 4, 5, 6, 7, 8,9, 10, 11];
+}
+
# vim: ft=perl6

0 comments on commit 7bcdd2b

Please sign in to comment.