-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Wrong warning emitted during implicit resolution #20484
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
better-errors
Issues concerned with improving confusing/unhelpful diagnostic messages
itype:enhancement
Comments
Swapping the definition of the givens doesn't emit the warning: given Char = ???
given Int = ???
val a = summon[Int] |
Discussion here: #20480 |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
May 28, 2024
hamzaremmal
added a commit
that referenced
this issue
May 28, 2024
Warn about priority change in implicit search only if one of the participating candidates appears in the final result. It could be that we have an priority change between two ranked candidates that both are superseded by the result of the implicit search. In this case, no warning needs to be reported. This PR is #20480 with different code for the last commit. I tried to avoid entangling the priority handling too much in the returns types and spent a side effect instead. I believe it's more efficient that way, since priority warnings are very rare. Fixes #20484
WojciechMazur
pushed a commit
to WojciechMazur/dotty
that referenced
this issue
Jul 2, 2024
WojciechMazur
pushed a commit
to WojciechMazur/dotty
that referenced
this issue
Jul 2, 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
better-errors
Issues concerned with improving confusing/unhelpful diagnostic messages
itype:enhancement
Compiler version
current main branch (d3df8ca)
Minimized example
Output Error/Warning message
Why this Error/Warning was not helpful
This warning should not be triggered at the first place. When printing the ast after typer, we can see that it resolved to the correct
given
. We can see that the compiler will emit the following code:We observe the correct behaviour if we set the source version to 3.4 or 3.6
Suggested improvement
The warning should not be emitted at the first place.
The text was updated successfully, but these errors were encountered: