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

LinkedListLike should implement clone #4813

Closed
scabug opened this issue Jul 17, 2011 · 2 comments
Closed

LinkedListLike should implement clone #4813

scabug opened this issue Jul 17, 2011 · 2 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Jul 17, 2011

Because a "list" is just the head link of a chain, the clone method currently clones only the head link. The new head link references the same second link as the original list and so, for example, appending to either list affects both. To avoid the ugly side effects that this can produce, LinkedListLike should implement clone() to perform a deep clone of all of the nodes on the list.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jul 17, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4813?orig=1
Reporter: Donald McLean (dmclean)
Affected Versions: 2.9.1
Other Milestones: 2.10.0

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 10, 2012

@jsuereth said:
scala/scala#1281

part of general clone cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.