From 7c1345050dfb9de6a9eab899a403f69d23b61a07 Mon Sep 17 00:00:00 2001 From: Eugene Flesselle Date: Fri, 28 Jun 2024 15:33:02 +0200 Subject: [PATCH 1/2] Add regression test for #20288 fixed in #20527 Close #20288 [Cherry-picked 5becb63d609f6f1852f196ea65688a0c5b665ee6] --- tests/pos/i20288.scala | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/pos/i20288.scala 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 + ) +} From 739247b08c1bd47c26c248b32bcce9f9c5bc93b8 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Mon, 8 Jul 2024 21:33:43 +0200 Subject: [PATCH 2/2] Fix outputs of i16723 after fixed error code id --- tests/warn/i16723.check | 2 +- tests/warn/i16723a.check | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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