File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,8 @@ sealed trait Tuple extends Product {
11
11
inline def toArray : Array [Object ] =
12
12
runtime.Tuples .toArray(this )
13
13
14
- /** Create a copy this tuple as a List */
15
- inline def toList [This >: this .type <: Tuple ]: List [Union [This ]] =
16
- this .productIterator.toList.asInstanceOf [List [Union [This ]]]
14
+ private [scala] inline def toList : List [Union [this .type ]] =
15
+ this .productIterator.toList.asInstanceOf [List [Union [this .type ]]]
17
16
18
17
/** Create a copy this tuple as an IArray */
19
18
inline def toIArray : IArray [Object ] =
@@ -231,6 +230,11 @@ object Tuple {
231
230
232
231
def fromProductTyped [P <: Product ](p : P )(using m : scala.deriving.Mirror .ProductOf [P ]): m.MirroredElemTypes =
233
232
runtime.Tuples .fromProduct(p).asInstanceOf [m.MirroredElemTypes ]
233
+
234
+ /** Create a copy this tuple as a List */
235
+ extension [This <: Tuple ](inline tuple : This )
236
+ inline def toList : List [Union [This ]] =
237
+ tuple.productIterator.toList.asInstanceOf [List [Union [This ]]]
234
238
}
235
239
236
240
/** A tuple of 0 elements */
You can’t perform that action at this time.
0 commit comments