You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala>caseclassFoo()
// defined case class Foo
scala>Tuple.fromProduct(Foo())
java.lang.AssertionError: assertion failed
at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:11)
at scala.runtime.TupleXXL.<init>(TupleXXL.scala:4)
at scala.runtime.TupleXXL$.fromIArray(TupleXXL.scala:45)
at scala.runtime.Tuples$.fromProduct(Tuples.scala:174)
at scala.Tuple$.fromProduct(Tuple.scala:229)
... 27 elided
Expectation
Tuple.fromProduct(Foo()) should return EmptyTuple.
On this note: Why is it called EmptyTuple instead of Tuple0?
We have Function0, Product0 (at least I think we do) and EmptyTuple, which appears to be inconsistent naming-wise.
Solution
The match in scala.runtime.Tuples.fromProduct simply needs another branch, similar to the one already present in fromArray.
The text was updated successfully, but these errors were encountered:
Compiler version
3.0.0-RC1
Minimized code
Expectation
Tuple.fromProduct(Foo())
should returnEmptyTuple
.On this note: Why is it called
EmptyTuple
instead ofTuple0
?We have
Function0
,Product0
(at least I think we do) andEmptyTuple
, which appears to be inconsistent naming-wise.Solution
The
match
inscala.runtime.Tuples.fromProduct
simply needs another branch, similar to the one already present infromArray
.The text was updated successfully, but these errors were encountered: