Skip to content

Commit c2d8035

Browse files
committed
Fix scala#5269: Fix StagedTuple/Tuple implementation
1 parent 1223cb6 commit c2d8035

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

library/src-scala3/scala/StagedTuple.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,7 @@ object StagedTuple {
190190
case Some(4) =>
191191
self.as[Tuple4[_, _, _, _]].bind(t => '(Tuple5(~x, (~t)._1, (~t)._2, (~t)._3, (~t)._4)))
192192
case Some(n) =>
193-
// TODO bind in toArrayStaged instead
194-
val arr = '($consArray(~x, ~toArrayStaged(self, tailSize)))
195-
arr.bind(arr => fromArrayStaged[H *: T](arr, Some(n + 1)))
193+
fromArrayStaged[H *: T]('($consArray(~x, ~toArrayStaged(self, tailSize))), Some(n + 1))
196194
case _ =>
197195
'(dynamic_*:[T, H](~self, ~x))
198196
}

library/src-scala3/scala/Tuple.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ object Tuple {
131131
val t = self.asInstanceOf[Tuple4[Object, Object, Object, Object]]
132132
Array(t._1, t._2, t._3, t._4)
133133
case self: TupleXXL =>
134-
asInstanceOf[TupleXXL].elems
134+
self.elems
135135
case self: Product =>
136136
val arr = new Array[Object](self.productArity)
137137
for (i <- 0 until arr.length) arr(i) = self.productElement(i).asInstanceOf[Object]

0 commit comments

Comments
 (0)