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)