summaryrefslogtreecommitdiff
path: root/test/files/pos/spec-List.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/spec-List.scala')
-rw-r--r--test/files/pos/spec-List.scala9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/files/pos/spec-List.scala b/test/files/pos/spec-List.scala
index a68e2774cb..b746eca44b 100644
--- a/test/files/pos/spec-List.scala
+++ b/test/files/pos/spec-List.scala
@@ -144,7 +144,7 @@ sealed abstract class 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: BuilderFactory[B, That, List[A]]): That = {
+ override def ++[B >: A, That](that: Traversable[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)
@@ -153,7 +153,7 @@ sealed abstract class List[@specialized +A] extends LinearSeq[A]
/** 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: BuilderFactory[B, That, List[A]]): 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.
@@ -496,7 +496,10 @@ object List extends SeqFactory[List] {
import collection.{Iterable, Seq, Vector}
- implicit def builderFactory[A]: BuilderFactory[A, List[A], Coll] = new VirtualBuilderFactory[A]
+ implicit def builderFactory[A]: CanBuildFrom[Coll, A, List[A]] =
+ new GenericCanBuildFrom[A] {
+ def apply() = newBuilder[A]
+ }
def newBuilder[A]: Builder[A, List[A]] = new ListBuffer[A]
override def empty[A]: List[A] = Nil