@@ -147,15 +147,14 @@ object NamedTupleDecomposition:
147
147
inline def head : Head [NamedTuple [N , V ]] = apply(0 )
148
148
149
149
/** The last element value of this tuple */
150
- inline def last : Last [NamedTuple [N , V ]] = apply(size - 1 ).asInstanceOf [Tuple . Last [V ]]
150
+ inline def last : Last [NamedTuple [N , V ]] = apply(size - 1 ).asInstanceOf [Last [NamedTuple [ N , V ] ]]
151
151
152
152
/** The tuple consisting of all elements of this tuple except the last one */
153
153
inline def init : Init [NamedTuple [N , V ]] =
154
- x.toTuple. take(size - 1 ).asInstanceOf [Init [NamedTuple [N , V ]]]
154
+ x.take(size - 1 ).asInstanceOf [Init [NamedTuple [N , V ]]]
155
155
156
156
/** The tuple consisting of all elements of this tuple except the first one */
157
- inline def tail : Tail [NamedTuple [N , V ]] =
158
- x.toTuple.drop(1 ).asInstanceOf [Tail [NamedTuple [N , V ]]]
157
+ inline def tail : Tail [NamedTuple [N , V ]] = x.toTuple.drop(1 )
159
158
160
159
/** The tuple consisting of the first `n` elements of this tuple, or all
161
160
* elements if `n` exceeds `size`.
@@ -182,7 +181,7 @@ object NamedTupleDecomposition:
182
181
* If `x = (n1 = v1, ..., ni = vi)` then `x.map(f) = `(n1 = f(v1), ..., ni = f(vi))`.
183
182
*/
184
183
inline def map [F [_]](f : [t] => t => F [t]): Map [NamedTuple [N , V ], F ] =
185
- x.toTuple.map(f). asInstanceOf [ NamedTuple [ N , Tuple . Map [ V , F ]]]
184
+ x.toTuple.map(f)
186
185
187
186
/** The named tuple consisting of all elements of this tuple in reverse */
188
187
inline def reverse : Reverse [NamedTuple [N , V ]] = x.toTuple.reverse
@@ -198,7 +197,7 @@ object NamedTupleDecomposition:
198
197
x.toTuple.zip(that.toTuple)
199
198
200
199
/** A list consisting of all element values */
201
- inline def toList : List [Tuple .Union [V ]] = x.toTuple.toList. asInstanceOf [ List [ Tuple . Union [ V ]]]
200
+ inline def toList : List [Tuple .Union [V ]] = x.toTuple.toList
202
201
203
202
/** An array consisting of all element values */
204
203
inline def toArray : Array [Object ] = x.toTuple.toArray
0 commit comments