diff --git a/tests/pos/i23095/defs.scala b/tests/pos/i23095/defs.scala new file mode 100644 index 000000000000..085c63019ef6 --- /dev/null +++ b/tests/pos/i23095/defs.scala @@ -0,0 +1,18 @@ +import scala.compiletime.* +import scala.deriving.* + +trait SeqStringCodec[A]: + def decode(value: Seq[String]): Either[Any, A] + +trait UrlForm +trait FormCodec[A] + +object FormCodec { + inline given derived[A](using p: Mirror.ProductOf[A]): FormCodec[A] = + val codecs = summonAll[Tuple.Map[p.MirroredElemTypes, SeqStringCodec]].toArray + val values = codecs.map { + _.asInstanceOf[SeqStringCodec[?]] + .decode(List.empty[String]) + } + ??? +} diff --git a/tests/pos/i23095/test.scala b/tests/pos/i23095/test.scala new file mode 100644 index 000000000000..cf7a321cbcdf --- /dev/null +++ b/tests/pos/i23095/test.scala @@ -0,0 +1,3 @@ +given SeqStringCodec[Int] = ??? +given SeqStringCodec[String] = ??? +final case class Form(int: Int, string: String) derives FormCodec