-
Notifications
You must be signed in to change notification settings - Fork 1.1k
NoSuchMethodError when accessing an override val via super #16704
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
Observations:
|
@sjrd Maybe you have an idea about what could be the cause of this? Does the JS backend have the same problem? |
I can take a look at this one (and its cousin on Scala 2) |
Scala.js has the same issue (most likely from the same cause in an earlier phase):
|
By the way, I think an override method that does not include a trait A {
def f: String
}
trait C extends A {
// What is the purpose? Implementing A.f, or transforming A.f?
override val f = "C"
} If there is a lint error is raised for the above code, the author of trait A {
def f: String
}
trait C extends A {
// The purpose is implementing A.f
val f = "C"
} or add the missing call to super class: trait A {
def f: String
}
trait C extends A {
// The purpose is transforming A.f
abstract override val f = s"${super.f}/C"
} |
I added a comment here: scala/bug#12715 (comment) |
Compiler version
3.2.0
Minimized code
Output
Note that this bug can be reproduced in Scala 2, too. See scala/bug#12715
Expectation
No error
The text was updated successfully, but these errors were encountered: