Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

RT #103332, for loops, lexicals and recursion

  • Loading branch information...
commit fe4c35b3ee5bbaf99757dfff37af83aa20988824 1 parent 48af882
@moritz moritz authored
Showing with 15 additions and 1 deletion.
  1. +15 −1 S04-statements/for.t
View
16 S04-statements/for.t
@@ -13,7 +13,7 @@ for statement as possible
=end description
-plan 66;
+plan 67;
## No foreach
# L<S04/The C<for> statement/"no foreach statement any more">
@@ -311,6 +311,20 @@ class TestClass{ has $.key is rw };
is $gather, '21....1....1....', 'Can mix recursion and for';
}
+# another variation
+{
+ my $t = '';
+ my $c;
+ sub r($x) {
+ my $h = $c++;
+ r $x-1 if $x;
+ for 1 { $t ~= $h };
+ };
+ r 3;
+ #?rakudo todo 'RT 103332'
+ is $t, '3210', 'can mix recursion and for (RT 103332)';
+}
+
# grep and sort in for - these were pugs bugs once, so let's
# keep them as regression tests
Please sign in to comment.
Something went wrong with that request. Please try again.