Skip to content

Instantly share code, notes, and snippets.

@lazyval
Created October 4, 2013 12:37
Show Gist options
  • Save lazyval/6825280 to your computer and use it in GitHub Desktop.
Save lazyval/6825280 to your computer and use it in GitHub Desktop.
val l1 = LinkedList(1)
l1.append(LinkedList(7))
l1
// res14: scala.collection.mutable.LinkedList[Int] = LinkedList(1, 7)
val l0 = LinkedList[Int]()
l0.append(LinkedList(7))
l0
// res16: scala.collection.mutable.LinkedList[Int] = LinkedList()
// Not a bug per see, but rather a *feature* as scaladoc states
// /** If `this` is empty then it does nothing and returns `that`. Otherwise, appends `that` to `this`. The append
// * requires a full traversal of `this`.
@japgolly
Copy link

japgolly commented Oct 5, 2013

:(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment