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 affects the original object in Rakudo #3172

Closed
p6rt opened this issue Jun 21, 2013 · 8 comments
Closed

.clone affects the original object in Rakudo #3172

p6rt opened this issue Jun 21, 2013 · 8 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 21, 2013

Migrated from rt.perl.org#118559 (status was 'resolved')

Searchable as RT118559$

@p6rt
Copy link
Author

p6rt commented Jun 21, 2013

From @masak

<ssutch> r​: class Foob { has @​.fields; }; my $x =
Foob.new(fields=>['a','b']); my $x2 = $x.clone(​:fields('c','d')); say
$x.fields; say $x2.fields;
<camelia> rakudo 49f111​: OUTPUT«c d␤c d␤»
<ssutch> clone appears to be affecting the original object?
* masak submits rakudobug
<timotimo> wow, it gets stranger and stranger
<timotimo> also​: try :fields<c d> on for size :)

Needless to say, .clone shouldn't change the attributes of the cloned
objects, only of the clone.

@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

From @usev6

I added a test (fudged 'todo') to S12-attributes/instance.t with commit Raku/roast@dbf53cb4b1

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

From @usev6

I added a test (fudged 'todo') to S12-attributes/instance.t with commit Raku/roast@dbf53cb4b1

@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 3, 2015

From @lizmat

Fixed with 0c88527472c14cf9f834, tests unfudged.

On 21 Jun 2013, at 02​:26, Carl Mäsak (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by "Carl Mäsak"
# Please include the string​: [perl #​118559]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=118559 >

<ssutch> r​: class Foob { has @​.fields; }; my $x =
Foob.new(fields=>['a','b']); my $x2 = $x.clone(​:fields('c','d')); say
$x.fields; say $x2.fields;
<camelia> rakudo 49f111​: OUTPUT«c d␤c d␤»
<ssutch> clone appears to be affecting the original object?
* masak submits rakudobug
<timotimo> wow, it gets stranger and stranger
<timotimo> also​: try :fields<c d> on for size :)

Needless to say, .clone shouldn't change the attributes of the cloned
objects, only of the clone.

@p6rt
Copy link
Author

p6rt commented Jul 8, 2015

From @usev6

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jul 8, 2015

From @usev6

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Jul 8, 2015

@usev6 - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jul 8, 2015
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant