Skip to content

Commit a2c15a3

Browse files
committed
address review comments
1 parent 2ff227b commit a2c15a3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

library/src/scala/runtime/TupleMirror.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ package scala.runtime
44
* as we do not need to synthesize an anonymous Mirror class at every callsite.
55
*/
66
final class TupleMirror(arity: Int) extends scala.deriving.Mirror.Product with Serializable:
7-
assert(arity > 0) // EmptyTuple is not a valid `MirroredType` for TupleMirror
7+
assert(arity >= 0) // technically could be used for EmptyTuple also, but it has its own singleton mirror.
88

9-
override type MirroredMonoType <: NonEmptyTuple
9+
override type MirroredMonoType <: Tuple
1010

1111
final def fromProduct(product: Product): MirroredMonoType =
1212
if product.productArity != arity then
1313
throw IllegalArgumentException(s"expected Product with $arity elements, got ${product.productArity}")
1414
runtime.Tuples.fromProduct(product).asInstanceOf[MirroredMonoType]
15-
16-
override final def toString: String = s"<tuple-mirror@${Integer.toHexString(hashCode).nn.take(6)}>"

0 commit comments

Comments
 (0)