Skip to content

Fix the first example under "Parameter Types of Function Values" #9519

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
Aug 18, 2020
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
7 changes: 4 additions & 3 deletions docs/docs/reference/changed-features/overload-resolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ that the remaining parameters suffice for picking a variant of the overloaded fu
For example, the following code compiles in Dotty, while it results in an
missing parameter type error in Scala2:
```scala
def f(x: Int, f: Int => Int) = f(x)
def f(x: String, f: String => String) = f(x)
f("a", _.length)
def f(x: Int, f2: Int => Int) = f2(x)
def f(x: String, f2: String => String) = f2(x)
f("a", _.toUpperCase)
f(2, _ * 2)
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using m for methods and keep f for function parameters?

To make this work, the rules for overloading resolution in section 6.23.3 of the SLS are modified
as follows:
Expand Down