Skip to content

Commit 75f7cb3

Browse files
authored
Merge pull request #11793 from sirthias/master
Fix #11792 (Tuple.fromProduct doesn't handle Product0)
2 parents 5f88058 + b57cd71 commit 75f7cb3

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

library/src/scala/runtime/Tuples.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ object Tuples {
5858
else TupleXXL.fromIArray(xs).asInstanceOf[Tuple]
5959

6060
def fromProduct(xs: Product): Tuple = (xs.productArity match {
61+
case 0 => EmptyTuple
6162
case 1 =>
6263
xs match {
6364
case xs: Tuple1[_] => xs

tests/run/i11793.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
case class Foo()
2+
@main def Test: Unit = Tuple.fromProduct(Foo())

0 commit comments

Comments
 (0)