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
List assignment to an array inside a signature produces a double array in Rakudo #1687
Comments
From tim.bollman@live.comThis is on the latest rakudo.
Should be ["2", "3"] Small discussion of this can be found on #perl6 at 04:26 UTC on Feb 20. Alpha has the correct behavior. Thanks, |
From @masak<masak> rakudo: my @a = 1,2,3; my (@c) = @a; say @c.perl |
From @finanalystThe syntax my ($x,@f) generates a two dimensional array in @f. Alpha produces what I would expect. Rakudo doesnt. If the current version of rakudo is correct, then how to specify a From #perl6 April 20 9.15 finanalyst: alpha: $_="a\tb\tc"; my ($k,@f) = map { .trim }, my ($k,@f) appears to be the correct syntax. See below finanalyst: rakudo: $_="a\tb\tc"; my $k,@f = map { .trim }, |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in at least one of these files: t/spec/S02-names_and_variables/signature.t, t/spec/S06-signature/passing-arrays.t commit b43d5859691e04a410a5a72af5d363612a967c9f [t/spec] test for RT #74336 Inline Patchdiff --git a/t/spec/S02-names_and_variables/signature.t b/t/spec/S02-names_and_variables/signature.t
index 6f263a2..ca74e07 100644
--- a/t/spec/S02-names_and_variables/signature.t
+++ b/t/spec/S02-names_and_variables/signature.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 11;
+plan 12;
# The :() form constructs signatures similar to how \() constructs Captures.
# A subroutine's .signature is a Siglist object.
@@ -75,4 +75,13 @@ plan 11;
"a subroutine's siglist can be accessed via .signature (3)";
}
+{
+ my @a = 1,2,3;
+ my (@c) = @a;
+ my $i = 0;
+ $i++ for @c;
+ #?rakudo todo 'RT 74336'
+ is $i, 3, 'asigning to an array in a signature is sane';
+}
+
# vim: ft=perl6
diff --git a/t/spec/S06-signature/passing-arrays.t b/t/spec/S06-signature/passing-arrays.t
index d76471b..95c7a3f 100644
--- a/t/spec/S06-signature/passing-arrays.t
+++ b/t/spec/S06-signature/passing-arrays.t
@@ -14,6 +14,7 @@ plan 11;
}
is count([1, 2, 3, 4]), 4, 'count([1, 2, 3, 4])';
+ #?rakudo skip 'bogus error message'
is count(my @b = 1, 2, 3, 4), 4, 'count(my @b = 1, 2, 3)';
is count((1, 2, 3)), 3, 'count((1, 2, 3))';
|
The RT System itself - Status changed from 'new' to 'open' |
From @moritzjnthn++ fixed this, test now passes. |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#74336 (status was 'resolved')
Searchable as RT74336$
The text was updated successfully, but these errors were encountered: