summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library/scala/collection/GenTraversableOnce.scala8
-rw-r--r--src/library/scala/collection/Iterator.scala4
-rw-r--r--src/library/scala/collection/TraversableLike.scala4
-rw-r--r--src/library/scala/collection/parallel/ParIterableLike.scala2
-rw-r--r--test/files/run/collection-conversions.scala14
5 files changed, 16 insertions, 16 deletions
diff --git a/src/library/scala/collection/GenTraversableOnce.scala b/src/library/scala/collection/GenTraversableOnce.scala
index d22fb0f3ad..2996071d71 100644
--- a/src/library/scala/collection/GenTraversableOnce.scala
+++ b/src/library/scala/collection/GenTraversableOnce.scala
@@ -562,13 +562,13 @@ trait GenTraversableOnce[+A] extends Any {
def toVector: Vector[A]
/** Converts this $coll into another by copying all elemnents.
- * $willNotTerminateInf
+ * @tparam Col The collection type to build.
* @return a new collection containing all elements of this $coll.
*
- * @usecase def copyInto[Col[_]]: Col[A]
+ * @usecase def copyTo[Col[_]]: Col[A]
* @inheritdoc
* $willNotTerminateInf
- * @return a new collection containing all elemnts of this $coll.
+ * @return a new collection containing all elements of this $coll.
*/
- def copyInto[Col[_]](implicit cbf: CanBuildFrom[Nothing, A, Col[A @uV]]): Col[A @uV]
+ def copyTo[Col[_]](implicit cbf: CanBuildFrom[Nothing, A, Col[A @uV]]): Col[A @uV]
}
diff --git a/src/library/scala/collection/Iterator.scala b/src/library/scala/collection/Iterator.scala
index 62449c7712..4283120519 100644
--- a/src/library/scala/collection/Iterator.scala
+++ b/src/library/scala/collection/Iterator.scala
@@ -1141,8 +1141,8 @@ trait Iterator[+A] extends TraversableOnce[A] {
if (self.hasNext) Stream.cons(self.next, self.toStream)
else Stream.empty[A]
- def toVector: Vector[A] = copyInto[Vector]
- def copyInto[Col[_]](implicit cbf: CanBuildFrom[Nothing, A, Col[A @uV]]): Col[A @uV] = {
+ def toVector: Vector[A] = copyTo[Vector]
+ def copyTo[Col[_]](implicit cbf: CanBuildFrom[Nothing, A, Col[A @uV]]): Col[A @uV] = {
val b = cbf()
while(hasNext) b += next
b.result
diff --git a/src/library/scala/collection/TraversableLike.scala b/src/library/scala/collection/TraversableLike.scala
index 898ea4d654..68abc36bf7 100644
--- a/src/library/scala/collection/TraversableLike.scala
+++ b/src/library/scala/collection/TraversableLike.scala
@@ -616,8 +616,8 @@ trait TraversableLike[+A, +Repr] extends Any
def toTraversable: Traversable[A] = thisCollection
def toIterator: Iterator[A] = toStream.iterator
def toStream: Stream[A] = toBuffer.toStream
- def toVector: Vector[A] = copyInto[Vector]
- def copyInto[Col[_]](implicit cbf: CanBuildFrom[Nothing, A, Col[A @uV]]): Col[A @uV] = {
+ def toVector: Vector[A] = copyTo[Vector]
+ def copyTo[Col[_]](implicit cbf: CanBuildFrom[Nothing, A, Col[A @uV]]): Col[A @uV] = {
val b = cbf()
b.sizeHint(this)
b ++= thisCollection
diff --git a/src/library/scala/collection/parallel/ParIterableLike.scala b/src/library/scala/collection/parallel/ParIterableLike.scala
index ed667d85a0..12b777832e 100644
--- a/src/library/scala/collection/parallel/ParIterableLike.scala
+++ b/src/library/scala/collection/parallel/ParIterableLike.scala
@@ -853,7 +853,7 @@ self: ParIterableLike[T, Repr, Sequential] =>
override def toVector: Vector[T] = seq.toVector
- override def copyInto[Col[_]](implicit cbf: CanBuildFrom[Nothing, T, Col[T @uncheckedVariance]]): Col[T @uncheckedVariance] = seq.copyInto[Col]
+ override def copyTo[Col[_]](implicit cbf: CanBuildFrom[Nothing, T, Col[T @uncheckedVariance]]): Col[T @uncheckedVariance] = seq.copyTo[Col]
/* tasks */
diff --git a/test/files/run/collection-conversions.scala b/test/files/run/collection-conversions.scala
index df12134c04..390ba06dac 100644
--- a/test/files/run/collection-conversions.scala
+++ b/test/files/run/collection-conversions.scala
@@ -34,17 +34,17 @@ object Test {
val tmp = col
println("-- Testing " + name + " ---")
printResult("[Direct] Vector ", col.toVector, testVector)
- printResult("[Copy] Vector ", col.copyInto[Vector], testVector)
+ printResult("[Copy] Vector ", col.copyTo[Vector], testVector)
printResult("[Direct] Buffer ", col.toBuffer, testBuffer)
- printResult("[Copy] Buffer ", col.copyInto[Buffer], testBuffer)
+ printResult("[Copy] Buffer ", col.copyTo[Buffer], testBuffer)
printResult("[Direct] GenSeq ", col.toSeq, testGenSeq)
- printResult("[Copy] GenSeq ", col.copyInto[GenSeq], testGenSeq)
- printResult("[Copy] Seq ", col.copyInto[Seq], testSeq)
+ printResult("[Copy] GenSeq ", col.copyTo[GenSeq], testGenSeq)
+ printResult("[Copy] Seq ", col.copyTo[Seq], testSeq)
printResult("[Direct] Stream ", col.toStream, testStream)
- printResult("[Copy] Stream ", col.copyInto[Stream], testStream)
+ printResult("[Copy] Stream ", col.copyTo[Stream], testStream)
printResult("[Direct] Array ", col.toArray, testArray)
- printResult("[Copy] Array ", col.copyInto[Array], testArray)
- printResult("[Copy] ParVector", col.copyInto[ParVector], testParVector)
+ printResult("[Copy] Array ", col.copyTo[Array], testArray)
+ printResult("[Copy] ParVector", col.copyTo[ParVector], testParVector)
}
def main(args: Array[String]): Unit = {