We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dd42e2a + fe0ce76 commit 96e45a7Copy full SHA for 96e45a7
library/src/scala/IArray.scala
@@ -268,6 +268,12 @@ object IArray {
268
// A convenience to avoid having to cast everything by hand
269
private given [A] as Conversion[Array[A], IArray[A]] = identity[Sub[A]]
270
271
+ /** Convert an array into an immutable array without copying, the original array
272
+ * must _not_ be mutated after this or the guaranteed immutablity of IArray will
273
+ * be violated.
274
+ */
275
+ def unsafeFromArray[T](s: Array[T]): IArray[T] = s
276
+
277
/** An immutable array of length 0. */
278
def empty[T: ClassTag]: IArray[T] = new Array[T](0)
279
0 commit comments