-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Incorrect warning about ambiguous implicit #20572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
area:implicits
related to implicits
area:reporting
Error reporting including formatting, implicit suggestions, etc
itype:bug
Comments
i was able to minimize it (using 3.5.0-RC2):
gives
https://scastie.scala-lang.org/OlegYch/io8Z28sZTC2qIUA3lqJtSw/146 |
I've just run into this on Scala 3.5.0-RC2 as well with 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 |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 5, 2024
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 5, 2024
EugeneFlesselle
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 5, 2024
odersky
added a commit
that referenced
this issue
Jul 8, 2024
WojciechMazur
pushed a commit
to WojciechMazur/dotty
that referenced
this issue
Jul 10, 2024
WojciechMazur
pushed a commit
to WojciechMazur/dotty
that referenced
this issue
Jul 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:implicits
related to implicits
area:reporting
Error reporting including formatting, implicit suggestions, etc
itype:bug
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
The text was updated successfully, but these errors were encountered: