-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Extension methods with the same name failing #18744
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
Comments
I was playing around with it and also discovered a crash. Submitted #18745 |
Minimizationobject 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()) // fails |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Oct 23, 2023
…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 scala#18745 Fixes scala#18744
WojciechMazur
pushed a commit
that referenced
this issue
Jun 22, 2024
…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 [Cherry-picked edc4bc8]
WojciechMazur
pushed a commit
that referenced
this issue
Jun 23, 2024
…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 [Cherry-picked edc4bc8]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.3.1
Minimized code
Output
Expectation
I would expect to be able to call
zipWith
onhello
as well.Notes
Some weird things I noticed: If I use
Int
instead ofColor
, the code compiles:However, if I just remove the
opaque
modifier fromColor
, the code still won't compile (even if I addinline
toColor#apply
).The text was updated successfully, but these errors were encountered: