-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" labelEvery issue needs to have an "area" and "itype" label
Description
Compiler version
3.7.4, 3.8.1-RC1-bin-20251125-ae54faa-NIGHTLY
Minimized code
import scala.deriving.Mirror
import NamedTuple.NamedTuple
object test {
def f[N <: Tuple, V <: Tuple] =
summon[Mirror.ProductOf[NamedTuple[N, V]]]
}Output
scala> test.f
val res0:
scala.deriving.Mirror.Product{
type MirroredMonoType = NamedTuple.NamedTuple[Tuple, Tuple];
type MirroredType = NamedTuple.NamedTuple[Tuple, Tuple];
type MirroredLabel = "NamedTuple";
type MirroredElemTypes = EmptyTuple.type;
type MirroredElemLabels = EmptyTuple.type
} = scala.runtime.TupleMirror@5d94ac8a
scala> test.f[("a", "b"),(Int, String)]
val res1:
scala.deriving.Mirror.Product{
type MirroredMonoType = (a : Int, b : String);
type MirroredType = (a : Int, b : String);
type MirroredLabel = "NamedTuple";
type MirroredElemTypes = EmptyTuple.type;
type MirroredElemLabels = EmptyTuple.type
} = scala.runtime.TupleMirror@6aa9a93b
scala> test.f[EmptyTuple, EmptyTuple].fromProduct(EmptyTuple)
val res1: NamedTuple.NamedTuple[EmptyTuple, EmptyTuple] = ()
scala> test.f[("a", "b"), (Int, String)].fromProduct((23, "xyz"))
java.lang.IllegalArgumentException: expected Product with 0 elements, got 2
at scala.runtime.TupleMirror.fromProduct(TupleMirror.scala:13)
at scala.runtime.TupleMirror.fromProduct(TupleMirror.scala:11)
... 30 elidedExpectation
Should not compile saying that it unable to derive a mirror for this case.
Metadata
Metadata
Assignees
Labels
itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" labelEvery issue needs to have an "area" and "itype" label