Skip to content

Commit d21d32e

Browse files
author
Antoine Brunner
committed
Add map extension method to DynamicTuple
1 parent 2828fcf commit d21d32e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

library/src/scala/runtime/DynamicTuple.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
package scala.runtime
22

33
import scala.Tuple.{ Concat, Size, Head, Tail, Elem, Zip, Map }
4+
import scala.reflect.ClassTag
45

56
object DynamicTuple {
7+
8+
given iarrayOps: [T](arr: IArray[T]) {
9+
def map[U: ClassTag](f: T => U): IArray[U] =
10+
arr.asInstanceOf[Array[T]].map(f).asInstanceOf[IArray[U]]
11+
}
12+
613
inline val MaxSpecialized = 22
714
inline private val XXL = MaxSpecialized + 1
815

0 commit comments

Comments
 (0)