Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/pos/i20288.scala
Original file line number Diff line number Diff line change
@@ -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
)
}
2 changes: 1 addition & 1 deletion tests/warn/i16723.check
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/warn/i16723a.check
Original file line number Diff line number Diff line change
@@ -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
Expand Down