diff --git a/tests/pos/i20288.scala b/tests/pos/i20288.scala new file mode 100644 index 000000000000..5c22dadf5b6d --- /dev/null +++ b/tests/pos/i20288.scala @@ -0,0 +1,23 @@ + +trait Decoder[A] +object Decoder { + given Decoder[DataRow] = ??? + extension [A <: Tuple](d: Decoder[A]) + def ~[B](fd: Field[B]): Decoder[Tuple.Concat[A, Tuple1[B]]] = ??? +} + +trait Field[A] +object Field: + val int: Field[Int] = ??? + extension [A](self: Field[A]) + def ~[B](that: Field[B])(using Decoder[DataRow]): Decoder[(A, B)] = ??? + +trait DataRow +def simpleQuery[S, A](query: String)(using Decoder[A]): Either[Throwable, A] = ??? + +@main def Test = { + import Decoder.* + val fails = simpleQuery("")(using + Field.int ~ Field.int ~ Field.int + ) +} diff --git a/tests/warn/i16723.check b/tests/warn/i16723.check index ed8e55502a80..6d55fa0a89d2 100644 --- a/tests/warn/i16723.check +++ b/tests/warn/i16723.check @@ -1,4 +1,4 @@ --- [E195] Potential Issue Warning: tests/warn/i16723.scala:3:2 --------------------------------------------------------- +-- [E197] Potential Issue Warning: tests/warn/i16723.scala:3:2 --------------------------------------------------------- 3 | new Object {} // warn | ^ | New anonymous class definition will be duplicated at each inline site diff --git a/tests/warn/i16723a.check b/tests/warn/i16723a.check index ba4794fac23e..ace11c5af1f9 100644 --- a/tests/warn/i16723a.check +++ b/tests/warn/i16723a.check @@ -1,4 +1,4 @@ --- [E195] Potential Issue Warning: tests/warn/i16723a.scala:5:38 ------------------------------------------------------- +-- [E197] Potential Issue Warning: tests/warn/i16723a.scala:5:38 ------------------------------------------------------- 5 |inline given Converter[Int, String] = new Converter { // warn | ^ | New anonymous class definition will be duplicated at each inline site