From 68e0a930bad6f4b703fc6875cc9c615ff6ba90d2 Mon Sep 17 00:00:00 2001 From: aherlihy Date: Fri, 13 Jun 2025 10:22:40 +0200 Subject: [PATCH] test case for #23095 --- tests/pos/i23095/defs.scala | 18 ++++++++++++++++++ tests/pos/i23095/test.scala | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 tests/pos/i23095/defs.scala create mode 100644 tests/pos/i23095/test.scala 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