@@ -11,27 +11,27 @@ sealed trait Tuple extends Any {
1111
1212 /** Create a copy this tuple as an Array */
1313 inline def toArray : Array [Object ] =
14- DynamicTuple .dynamicToArray (this )
14+ DynamicTuple .toArray (this )
1515
1616 /** Create a copy this tuple as an IArray */
1717 inline def toIArray : IArray [Object ] =
18- DynamicTuple .dynamicToIArray (this )
18+ DynamicTuple .toIArray (this )
1919
2020 /** Return a new tuple by prepending the element to `this` tuple.
2121 * This opteration is O(this.size)
2222 */
2323 inline def *: [H , This >: this .type <: Tuple ] (x : H ): H *: This =
24- DynamicTuple .dynamicCons[ H , This ] (x, this )
24+ DynamicTuple .cons (x, this ). asInstanceOf [ H *: This ]
2525
2626 /** Return a new tuple by concatenating `this` tuple with `that` tuple.
2727 * This opteration is O(this.size + that.size)
2828 */
2929 inline def ++ [This >: this .type <: Tuple ](that : Tuple ): Concat [This , that.type ] =
30- DynamicTuple .dynamicConcat[ This , that.type ]( this , that)
30+ DynamicTuple .concat( this , that). asInstanceOf [ Concat [ This , that.type ]]
3131
3232 /** Return the size (or arity) of the tuple */
3333 inline def size [This >: this .type <: Tuple ]: Size [This ] =
34- DynamicTuple .dynamicSize (this )
34+ DynamicTuple .size (this ). asInstanceOf [ Size [ This ]]
3535
3636 /** Given two tuples, `(a1, ..., an)` and `(a1, ..., an)`, returns a tuple
3737 * `((a1, b1), ..., (an, bn))`. If the two tuples have different sizes,
@@ -41,35 +41,35 @@ sealed trait Tuple extends Any {
4141 * `(A1, B1) *: ... *: (Ai, Bi) *: Tuple`
4242 */
4343 inline def zip [This >: this .type <: Tuple , T2 <: Tuple ](t2 : T2 ): Zip [This , T2 ] =
44- DynamicTuple .dynamicZip (this , t2)
44+ DynamicTuple .zip (this , t2). asInstanceOf [ Zip [ This , T2 ]]
4545
4646 /** Called on a tuple `(a1, ..., an)`, returns a new tuple `(f(a1), ..., f(an))`.
4747 * The result is typed as `(F[A1], ..., F[An])` if the tuple type is fully known.
4848 * If the tuple is of the form `a1 *: ... *: Tuple` (that is, the tail is not known
4949 * to be the cons type.
5050 */
5151 inline def map [F [_]](f : [t] => t => F [t]): Map [this .type , F ] =
52- DynamicTuple .dynamicMap (this , f)
52+ DynamicTuple .map (this , f). asInstanceOf [ Map [ this . type , F ]]
5353
5454 /** Given a tuple `(a1, ..., am)`, returns the tuple `(a1, ..., an)` consisting
5555 * of its first n elements.
5656 */
5757 inline def take [This >: this .type <: Tuple ](n : Int ): Take [This , n.type ] =
58- DynamicTuple .dynamicTake[ This , n.type ]( this , n)
58+ DynamicTuple .take( this , n). asInstanceOf [ Take [ This , n.type ]]
5959
6060
6161 /** Given a tuple `(a1, ..., am)`, returns the tuple `(an+1, ..., am)` consisting
6262 * all its elements except the first n ones.
6363 */
6464 inline def drop [This >: this .type <: Tuple ](n : Int ): Drop [This , n.type ] =
65- DynamicTuple .dynamicDrop[ This , n.type ]( this , n)
65+ DynamicTuple .drop( this , n). asInstanceOf [ Drop [ This , n.type ]]
6666
6767 /** Given a tuple `(a1, ..., am)`, returns a pair of the tuple `(a1, ..., an)`
6868 * consisting of the first n elements, and the tuple `(an+1, ..., am)` consisting
6969 * of the remaining elements.
7070 */
7171 inline def splitAt [This >: this .type <: Tuple ](n : Int ): Split [This , n.type ] =
72- DynamicTuple .dynamicSplitAt[ This , n.type ]( this , n)
72+ DynamicTuple .splitAt( this , n). asInstanceOf [ Split [ This , n.type ]]
7373}
7474
7575object Tuple {
@@ -165,7 +165,7 @@ object Tuple {
165165 case xs : Array [Object ] => xs
166166 case xs => xs.map(_.asInstanceOf [Object ])
167167 }
168- DynamicTuple .dynamicFromArray[ Tuple ] (xs2)
168+ DynamicTuple .fromArray (xs2). asInstanceOf [ Tuple ]
169169 }
170170
171171 /** Convert an immutable array into a tuple of unknown arity and types */
@@ -176,12 +176,12 @@ object Tuple {
176176 // TODO suport IArray.map
177177 xs.asInstanceOf [Array [T ]].map(_.asInstanceOf [Object ]).asInstanceOf [IArray [Object ]]
178178 }
179- DynamicTuple .dynamicFromIArray[ Tuple ] (xs2)
179+ DynamicTuple .fromIArray (xs2). asInstanceOf [ Tuple ]
180180 }
181181
182182 /** Convert a Product into a tuple of unknown arity and types */
183183 def fromProduct (product : Product ): Tuple =
184- runtime.DynamicTuple .dynamicFromProduct[ Tuple ] (product)
184+ runtime.DynamicTuple .fromProduct (product)
185185
186186 def fromProductTyped [P <: Product ](p : P )(using m : scala.deriving.Mirror .ProductOf [P ]): m.MirroredElemTypes =
187187 Tuple .fromArray(p.productIterator.toArray).asInstanceOf [m.MirroredElemTypes ] // TODO use toIArray of Object to avoid double/triple array copy
@@ -195,17 +195,17 @@ sealed trait NonEmptyTuple extends Tuple {
195195 * Equivalent to productElement but with a precise return type.
196196 */
197197 inline def apply [This >: this .type <: NonEmptyTuple ](n : Int ): Elem [This , n.type ] =
198- DynamicTuple .dynamicApply[ This , n.type ]( this , n)
198+ DynamicTuple .apply( this , n). asInstanceOf [ Elem [ This , n.type ]]
199199
200200 /** Get the head of this tuple */
201201 inline def head [This >: this .type <: NonEmptyTuple ]: Head [This ] =
202- DynamicTuple .dynamicApply[ This , 0 ] (this , 0 )
202+ DynamicTuple .apply (this , 0 ). asInstanceOf [ Head [ This ]]
203203
204204 /** Get the tail of this tuple.
205205 * This opteration is O(this.size)
206206 */
207207 inline def tail [This >: this .type <: NonEmptyTuple ]: Tail [This ] =
208- DynamicTuple .dynamicTail[ This ] (this )
208+ DynamicTuple .tail (this ). asInstanceOf [ Tail [ This ]]
209209
210210}
211211
0 commit comments