Skip to content

Commit e14f0b9

Browse files
author
Antoine Brunner
committed
Fix rebase issue
1 parent 8635f1d commit e14f0b9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

library/src/scala/runtime/DynamicTuple.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,12 @@ object DynamicTuple {
257257
).asInstanceOf[Zip[This, T2]]
258258
}
259259

260-
def dynamicMap[This <: Tuple, F[_]](self: This, f: [t] => t => F[t]): Map[This, F] =
261-
Tuple.fromArray(self.asInstanceOf[Product].productIterator.map(f(_)).toArray) // TODO use toIArray of Object to avoid double/triple array copy
262-
.asInstanceOf[Map[This, F]]
260+
def dynamicMap[This <: Tuple, F[_]](self: This, f: [t] => t => F[t]): Map[This, F] = (self: Any) match {
261+
case self: Unit => ().asInstanceOf[Map[This, F]]
262+
case _ =>
263+
Tuple.fromArray(self.asInstanceOf[Product].productIterator.map(f(_)).toArray) // TODO use toIArray of Object to avoid double/triple array copy
264+
.asInstanceOf[Map[This, F]]
265+
}
263266

264267
def consIterator(head: Any, tail: Tuple): Iterator[Any] =
265268
Iterator.single(head) ++ tail.asInstanceOf[Product].productIterator

0 commit comments

Comments
 (0)