Skip to content

Fix #5346: Refine implicit resolution spec #5633

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

Merged
merged 1 commit into from
Dec 17, 2018
Merged
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
8 changes: 8 additions & 0 deletions docs/docs/reference/changed/implicit-resolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,13 @@ affect implicits on the language level.
most (but not all) divergence errors in Scala 2 would terminate the implicit
search as a whole.

5. Scala-2 gives a lower level of priority to implicit conversions with call-by-name
parameters relative to implicit conversions with call-by-value parameters. Dotty
drops this distinction. So the following code snippet would be ambiguous in Dotty:

implicit def conv1(x: Int): A = new A(x)
implicit def conv2(x: => Int): A = new A(x)
def buzz(y: A) = ???
buzz(1) // error: ambiguous

[//]: # todo: expand with precise rules