summaryrefslogtreecommitdiff
path: root/test/files/pos/spec-List.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-03-27 05:41:47 +0000
committerPaul Phillips <paulp@improving.org>2010-03-27 05:41:47 +0000
commit0c8e2195960d47e5b9be93efb7c95802ae40dca6 (patch)
tree4546dbdde688402560032002b62fbea9d84b1343 /test/files/pos/spec-List.scala
parentec127ce60de679809a75c3c85f25ec4256b9dd13 (diff)
downloadscala-0c8e2195960d47e5b9be93efb7c95802ae40dca6.tar.gz
scala-0c8e2195960d47e5b9be93efb7c95802ae40dca6.tar.bz2
scala-0c8e2195960d47e5b9be93efb7c95802ae40dca6.zip
TraversableOnce. Review by odersky.
Diffstat (limited to 'test/files/pos/spec-List.scala')
-rw-r--r--test/files/pos/spec-List.scala12
1 files changed, 3 insertions, 9 deletions
diff --git a/test/files/pos/spec-List.scala b/test/files/pos/spec-List.scala
index 9535eaa32a..6a506aa4be 100644
--- a/test/files/pos/spec-List.scala
+++ b/test/files/pos/spec-List.scala
@@ -144,18 +144,12 @@ sealed trait List[@specialized +A] extends LinearSeq[A]
/** Create a new list which contains all elements of this list
* followed by all elements of Traversable `that'
*/
- override def ++[B >: A, That](that: Traversable[B])(implicit bf: CanBuildFrom[List[A], B, That]): That = {
+ override def ++[B >: A, That](xs: TraversableOnce[B])(implicit bf: CanBuildFrom[List[A], B, That]): That = {
val b = bf(this)
- if (b.isInstanceOf[ListBuffer[_]]) (this ::: that.toList).asInstanceOf[That]
- else super.++(that)
+ if (b.isInstanceOf[ListBuffer[_]]) (this ::: xs.toList).asInstanceOf[That]
+ else super.++(xs)
}
- /** Create a new list which contains all elements of this list
- * followed by all elements of Iterator `that'
- */
- override def ++[B >: A, That](that: Iterator[B])(implicit bf: CanBuildFrom[List[A], B, That]): That =
- this ++ that.toList
-
/** Overrides the method in Iterable for efficiency.
*
* @return the list itself