Details

      Description

      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.

        Activity

        Hide
        Josh Suereth added a comment -

        https://github.com/scala/scala/pull/1281

        part of general clone cleanup.

        Show
        Josh Suereth added a comment - https://github.com/scala/scala/pull/1281 part of general clone cleanup.

          People

          • Assignee:
            Josh Suereth
            Reporter:
            Donald McLean
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development