File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ sealed trait Tuple extends Product {
13
13
runtime.Tuples .toArray(this )
14
14
15
15
/** Create a copy of this tuple as a List */
16
- inline def toList : List [Union [this . type ]] =
16
+ inline def toList [ This >: this . type <: Tuple ] : List [Union [This ]] =
17
17
this .productIterator.toList
18
- .asInstanceOf [List [Union [this . type ]]]
18
+ .asInstanceOf [List [Union [This ]]]
19
19
20
20
/** Create a copy of this tuple as an IArray */
21
21
inline def toIArray : IArray [Object ] =
Original file line number Diff line number Diff line change
1
+ def toCsvFlat [A <: Product ](a : A )(using m : scala.deriving.Mirror .ProductOf [A ]) = {
2
+ def flatTuple (any : Any ): Tuple = any match
3
+ case p : Product => p.productIterator.map(flatTuple).foldLeft(EmptyTuple : Tuple )(_ ++ _)
4
+ case a => Tuple1 (a)
5
+
6
+ val tuple = flatTuple(Tuple .fromProductTyped(a)).toList
7
+ }
You can’t perform that action at this time.
0 commit comments