Skip to content

Commit 4987b14

Browse files
Merge pull request #11387 from dotty-staging/fix-IArray.from
Fix signature of IArray.from
2 parents ae7bbd8 + 9f4b032 commit 4987b14

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

library/src/scala/IArray.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,18 +427,18 @@ object IArray:
427427
/** Build an array from the iterable collection.
428428
*
429429
* {{{
430-
* scala> val a = Array.from(Seq(1, 5))
431-
* val a: Array[Int] = Array(1, 5)
430+
* scala> val a = IArray.from(Seq(1, 5))
431+
* val a: IArray[Int] = IArray(1, 5)
432432
*
433-
* scala> val b = Array.from(Range(1, 5))
434-
* val b: Array[Int] = Array(1, 2, 3, 4)
433+
* scala> val b = IArray.from(Range(1, 5))
434+
* val b: IArray[Int] = IArray(1, 2, 3, 4)
435435
* }}}
436436
*
437437
* @param it the iterable collection
438438
* @return an array consisting of elements of the iterable collection
439439
*/
440-
def from[A : ClassTag](it: IterableOnce[A]): Array[A] =
441-
Array.from(it)
440+
def from[A : ClassTag](it: IterableOnce[A]): IArray[A] =
441+
unsafeFromArray(Array.from(it))
442442

443443
def newBuilder[T](using t: ClassTag[T]): Builder[T, IArray[T]] =
444444
ArrayBuilder.make[T].mapResult(IArray.unsafeFromArray)

0 commit comments

Comments
 (0)