-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Overloaded assignment operators defined as extension methods across different objects fail to compile #18713
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
Minimizationimport language.experimental.relaxedExtensionImports
class A
object AA:
extension (a: A)
def f = ???
def f_=(x: String) = ???
object BB:
extension (b: Long)
def f = ???
def f_=(x: String) = ???
def test(a: A) =
import AA.*
import BB.*
a.f = "aa"
f_=(a)("aa")
|
When resolving the setter we get first type the prefix to |
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Oct 18, 2023
We already keep the qualifier as a typed splice if the prefix is an explicit Select. Fixes scala#18713
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Oct 18, 2023
We already keep the qualifier as a typed splice if the prefix is an explicit Select. Fixes scala#18713
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Oct 24, 2023
We already keep the qualifier as a typed splice if the prefix is an explicit Select. Fixes scala#18713
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Nov 9, 2023
We already keep the qualifier as a typed splice if the prefix is an explicit Select. Fixes scala#18713
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Nov 9, 2023
We already keep the qualifier as a typed splice if the prefix is an explicit Select. Fixes scala#18713
nicolasstucki
added a commit
that referenced
this issue
Nov 13, 2023
We already keep the qualifier as a typed splice if the prefix is an explicit Select. Fixes #18713
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.4.0-RC1-bin-20231006-b1ccc6a-NIGHTLY
Minimized code
Scastie: https://scastie.scala-lang.org/cYHDxwGgQzm3VBWrIHYQhA
a.scala
b.scala
main.scala
Output
If I remove
def f_=(x: String) = b.x = x
fromB
extension, it runs successfully withrun
in sbt console.When I then add it back, it runs successfully with
run
in sbt console, but fails again onrun
afterclean
, which is potentially a partial compilation bug.Expectation
aa
The text was updated successfully, but these errors were encountered: