-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retract SynthesizeExtMethodReceiver mode when going deeper in overloa…
…ding resolution The SynthesizeExtMethodReceiver mode is supposed to be turned on only for the direct application of of a synthesized receiver to the qualifier of an extension method selection. previously its lifetime was accidentally extended when overloading resolution looking at subsequent parameter lists because the first one was not enough to disambiguate. Fixes #18745 Fixes #18744
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package dotty.tools.dotc.typer | ||
|
||
object Color: | ||
def apply(): Int = ??? | ||
|
||
extension (u: Unit) | ||
def foo(that: String, f: Int => Int): Int = ??? | ||
def foo(that: Long, f: Int => Int): Int = ??? | ||
|
||
def test = | ||
val c = Color() | ||
().foo("", (_: Int) => c) | ||
().foo("", (_: Int) => Color()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
object Color: | ||
def apply(i: Int): Int = i | ||
|
||
type Plane | ||
|
||
object Plane: | ||
extension (plane: Plane) | ||
def zipWith(that: String, f: Int => Int): Int = ??? | ||
def zipWith(that: Int, f: Int => Int): Int = ??? | ||
|
||
import Plane.zipWith | ||
|
||
def test(p: Plane) = | ||
p.zipWith("", (_: Int) => Color(25)) |