Skip to content
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

.clone does not respect listyness of attribute #55

Open
samuraisam opened this issue Jun 20, 2013 · 0 comments
Open

.clone does not respect listyness of attribute #55

samuraisam opened this issue Jun 20, 2013 · 0 comments

Comments

@samuraisam
Copy link

Gist:
$object.clone() does not respect the listyness of attributes. When calling .clone(list_attr=>[$value]) the resulting list_attr is a list containing a list. When calling .clone(:list_attr($value)) the resulting list_attr is a list, as desired.

Gist, for reals: https://gist.github.com/samuraisam/5819387/44d63480908601244ea8bb09e28e0ecd32d117db

Relevant IRC Log

[18:08:03] <ssutch>  so, .clone works if i use the :arg(a,b,c) syntax
[18:08:11] <ssutch>  but not if use arg=>[a,b,c]
[18:08:15] <timotimo>    r: class Bob { has @.foo; }; Bob.new(:foo([1, 2, 3])).clone(:foo([1, 2, 3])).perl.say;
[18:08:16] <+camelia>    rakudo b2072f: OUTPUT«Bob.new(foo => Array.new([1, 2, 3]))␤»
[18:08:23] <timotimo>    oh, look!
[18:08:28] <ssutch>  yep
[18:08:32] <timotimo>    r: class Bob { has @.foo; }; Bob.new(:foo([1, 2, 3])).clone(:foo(1, 2, 3)).perl.say;
[18:08:32] <+camelia>    rakudo b2072f: OUTPUT«Bob.new(foo => Array.new(1, 2, 3))␤»
[18:08:48] <timotimo>    clone doesn't seem to know about the listyness of @.options
[18:09:48] <timotimo>    there's no test in the test suite that would cover it and there's no mention of how it should behave in the specs
[18:10:08] <timotimo>    so ... specbug?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant