Closed OlegYch closed 1 day ago
i was able to minimize it (using 3.5.0-RC2):
trait Writes[T]
trait Format[T] extends Writes[T]
given [T: List]: Writes[T] = null
given [T]: Format[T] = null
summon[Writes[Int]]
gives
Given search preference for Playground.Writes[Int] between alternatives (Playground.given_Format_T : [T]: Playground.Format[T]) and (Playground.given_Writes_T :
[T](implicit evidence$1: List[T]): Playground.Writes[T]) will change
Current choice : the first alternative
New choice from Scala 3.6: the second alternative
https://scastie.scala-lang.org/OlegYch/io8Z28sZTC2qIUA3lqJtSw/146
I've just run into this on Scala 3.5.0-RC2 as well with circe
-- https://scastie.scala-lang.org/jVQZCmzbRFaKxJk6AroUsw
import io.circe.Encoder
case class Foo[A]() derives Encoder
case class Bar[A](foo: Foo[A]) derives Encoder
yields an error
Given search preference for io.circe.Encoder[Playground.Foo[A]] between alternatives (Playground.Foo.derived$Encoder :
[A²](implicit x$0: io.circe.Encoder[A²]): io.circe.Encoder[Playground.Foo[A²]]
) and (io.circe.Encoder.encodeIterable :
[A², C[_$20]]
(implicit encodeA: io.circe.Encoder[A²], ev: C[A²] => Iterable[A²]):
io.circe.Encoder.AsArray[C[A²]]
) will change
Current choice : none - it's ambiguous
New choice from Scala 3.6: the first alternative
where: A is a type in given instance derived$Encoder²
A² is a type variable
Compiler version
3.5.0-RC1-3.5.1-RC1-bin-20240613-61a15b2-NIGHTLY
Minimized code
can't really minimize, but i hope the error message is enough here is an approximation but for some reason it doesn't produce a warning: https://scastie.scala-lang.org/OlegYch/io8Z28sZTC2qIUA3lqJtSw/36
Output
instead i get a warning:
for some reason it tries to apply enumNameWrites from play, but it's only applicable for scala.Enumeration, not enumeratum
Expectation
no warning