Closed
Description
Example
import scala.deriving.Mirror
@main def Test =
val mrr = summon[Mirror.Of[(Int, String)] { type MirroredElemTypes = (Int, Int, Int) }]
val ev1 = summon[(Int, Int, Int) =:= mrr.MirroredElemTypes]
val ev2 = summon[(Int, String) =:= mrr.MirroredElemTypes]
// val ev3 = summon[(Int, String) =:= (Int, Int, Int)] // Implicit not found (correct, but breaks transitivity)
val tup: (Int, String) = (1, "foo")
val res: mrr.MirroredElemTypes = tup
Run it:
Exception in thread "main" java.lang.ClassCastException: scala.Tuple2 cannot be cast to scala.Tuple3
at Test$package$.Test(Test.scala:10)
at Test.main(Test.scala:3)
Expectation
I would expect mrr
to be impossible to summon because of the bad refinement type.