From 9f4b0323885b3aef63e2374e4ad8ba8377334ab5 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Fri, 12 Feb 2021 09:16:44 +0100 Subject: [PATCH] Fix signature of IArray.from --- library/src/scala/IArray.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/src/scala/IArray.scala b/library/src/scala/IArray.scala index 0fcdfcec669c..50d40b6f2f19 100644 --- a/library/src/scala/IArray.scala +++ b/library/src/scala/IArray.scala @@ -427,18 +427,18 @@ object IArray: /** Build an array from the iterable collection. * * {{{ - * scala> val a = Array.from(Seq(1, 5)) - * val a: Array[Int] = Array(1, 5) + * scala> val a = IArray.from(Seq(1, 5)) + * val a: IArray[Int] = IArray(1, 5) * - * scala> val b = Array.from(Range(1, 5)) - * val b: Array[Int] = Array(1, 2, 3, 4) + * scala> val b = IArray.from(Range(1, 5)) + * val b: IArray[Int] = IArray(1, 2, 3, 4) * }}} * * @param it the iterable collection * @return an array consisting of elements of the iterable collection */ - def from[A : ClassTag](it: IterableOnce[A]): Array[A] = - Array.from(it) + def from[A : ClassTag](it: IterableOnce[A]): IArray[A] = + unsafeFromArray(Array.from(it)) def newBuilder[T](using t: ClassTag[T]): Builder[T, IArray[T]] = ArrayBuilder.make[T].mapResult(IArray.unsafeFromArray)