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
attribute of cloned object becomes Parcel instead of Array and Pair instead of Hash #4388
Comments
From @usev6When passing new values for an attribute '@.fields' as named parameters while cloning, the cloned object has the value of '@.fields' as a Parcel instead of an Array: $ perl6-j -e 'class Foo { has @.fields; }; my $x = Foo.new(:fields<a b>); my $x2 = $x.clone(:fields<c d>); say $x.fields.WHAT; say $x.fields.perl; say $x2.fields.WHAT; say $x2.fields.perl' A similar problem exists for Hash/Pair: $ perl6-j -e 'my class Foo { has %.h }; my $b1 = Foo.new( h => "a" => "b" ); my $b2 = $b1.clone( h => "c" => "d" ); say $b1.h.WHAT; say $b1.h.perl; say $b2.h.WHAT; say $b2.h.perl' $ perl6-j --version Moar gets this right. Please note that there is different code for Moar and JVM -- see commit rakudo/rakudo@7aa070e There are two tests (fudged 'todo') in S12-attributes/clone.t. |
From @peschwaOn Wed Jul 08 12:43:43 2015, bartolin@gmx.de wrote:
This was fixed in rakudo commit 0c78181 and the test file now passes on R-J. |
The RT System itself - Status changed from 'new' to 'open' |
From @usev6On Fri Apr 08 05:56:54 2016, peschwa@gmail.com wrote:
Thanks a lot! I'm closing this ticket as 'resolved'. |
@usev6 - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#125577 (status was 'resolved')
Searchable as RT125577$
The text was updated successfully, but these errors were encountered: