From 0c8e2195960d47e5b9be93efb7c95802ae40dca6 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sat, 27 Mar 2010 05:41:47 +0000 Subject: TraversableOnce. Review by odersky. --- test/files/pos/spec-List.scala | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'test/files/pos/spec-List.scala') 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 -- cgit v1.2.3