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 "is copy" parameters with value 0 doesn't work #1980
Comments
From @Kodiologist#perl6 on 29 July 2010: <Kodi> rakudo: sub f($a is copy = 1) { my $b; ($a, $b) = (1, 2); It turns out that the bug has more to do with the value 0 ./perl6 -e 'sub f($a is copy) { my $b; ($a, $b) = (1, 2); say $a; }; f(1)' |
@coke - Status changed from 'new' to 'open' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in at least one of these files: t/spec/S03-operators/assign.t, t/spec/S06-traits/is-copy.t commit 6a51dccb70a504c421a1de0c62c532aa86c6fb8f [t/spec] Added tests for RT #76804. Inline Patchdiff --git a/t/spec/S03-operators/assign.t b/t/spec/S03-operators/assign.t
index cbd6850..08056c5 100644
--- a/t/spec/S03-operators/assign.t
+++ b/t/spec/S03-operators/assign.t
@@ -556,7 +556,7 @@ sub l () { 1, 2 };
#?rakudo skip '$a[] autovivification (unspecced?)'
{
my $a;
- $a[] = l, l, l
+ $a[] = l, l, l;
is($a.elems, 6, 'lhs treats $a[] as list');
}
diff --git a/t/spec/S06-traits/is-copy.t b/t/spec/S06-traits/is-copy.t
index ae634e8..581f357 100644
--- a/t/spec/S06-traits/is-copy.t
+++ b/t/spec/S06-traits/is-copy.t
@@ -4,7 +4,7 @@ use Test;
# L<S06/"Parameter traits"/"=item is copy">
# should be moved with other subroutine tests?
-plan 17;
+plan 19;
{
sub foo($a is copy) {
@@ -73,4 +73,17 @@ plan 17;
is t($a), 3, 'passing [1,2,3] to @a is copy does results in three array items';
}
+# RT #76804
+#?rakudo skip 'RT 76804'
+{
+ sub f($arg is copy) {
+ my $other;
+ ($arg, $other) = 5, 6;
+ $arg;
+ };
+ is f(0), 5, 'list assignment (0)';
+ is f(1), 5, 'list assignment (1)';
+}
+
+
# vim: ft=perl6 |
From @moritzFixed in nom, this ticket can be closed when nom becomes master. |
From @cokeOn Mon Jul 04 01:53:43 2011, moritz wrote:
\o/ Closing ticket. -- |
@coke - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#76804 (status was 'resolved')
Searchable as RT76804$
The text was updated successfully, but these errors were encountered: