New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot loop over Capture object in Rakudo #1590
Comments
From @masak<moritz_> rakudo: my $i = 0; $i++ for \[1,2,3]; say $i; |
From @moritz12:07 <@moritz_> rakudo: say Capture ~~ Positional |
From @masak<moritz_> rakudo: my $x = Capture.new; say $x[0] |
From [Unknown Contact. See original ticket]<moritz_> rakudo: my $x = Capture.new; say $x[0] |
@masak - Status changed from 'new' to 'open' |
From @bbkrOn Kiev build: [12:16] <bbkr> rakudo: my $i = 0; $i++ for \[1,2,3]; say $i; |
The RT System itself - Status changed from 'new' to 'open' |
From @bbkr[12:23] <masak> bbkr: no, I think one iteration is right there. the Taking ticket for tests... |
From @bbkrtests added in t/spec/S04-statements/for_with_only_one_item.t |
@bbkr - Status changed from 'open' to 'resolved' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S04-statements/for_with_only_one_item.t commit 80da87df38b1166278e10ec410e9a3e1062c09b2 [t/spec] tests for RT #73400 Cannot loop over Capture object in Rakudo Inline Patchdiff --git a/t/spec/S04-statements/for_with_only_one_item.t b/t/spec/S04-statements/for_with_only_one_item.t
index 03842d0..caf26d6 100644
--- a/t/spec/S04-statements/for_with_only_one_item.t
+++ b/t/spec/S04-statements/for_with_only_one_item.t
@@ -6,7 +6,7 @@ use Test;
# Test primarily aimed at PIL2JS
-plan 8;
+plan 9;
# sanity tests
{
@@ -75,4 +75,13 @@ plan 8;
is $count, 1, 'for $arrayref {...} executes the loop body only once';
}
+# RT #73400
+{
+ my $capture = \[1,2,3];
+ my $count = 0;
+ for $capture { $count++ }
+
+ is $count, 1, 'for $capture {...} executes the loop body only once';
+}
+
# vim: ft=perl6 |
Migrated from rt.perl.org#73400 (status was 'resolved')
Searchable as RT73400$
The text was updated successfully, but these errors were encountered: