Skip to content

Commit 64a239f

Browse files
authored
Merge pull request #9519 from deanwampler/patch-1
Fix the first example under "Parameter Types of Function Values"
2 parents 693e81b + 1be7624 commit 64a239f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/docs/reference/changed-features/overload-resolution.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ that the remaining parameters suffice for picking a variant of the overloaded fu
5252
For example, the following code compiles in Dotty, while it results in an
5353
missing parameter type error in Scala2:
5454
```scala
55-
def f(x: Int, f: Int => Int) = f(x)
56-
def f(x: String, f: String => String) = f(x)
57-
f("a", _.length)
55+
def f(x: Int, f2: Int => Int) = f2(x)
56+
def f(x: String, f2: String => String) = f2(x)
57+
f("a", _.toUpperCase)
58+
f(2, _ * 2)
5859
```
5960
To make this work, the rules for overloading resolution in section 6.23.3 of the SLS are modified
6061
as follows:

0 commit comments

Comments
 (0)