-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Allow resolving declarations from parent scope #144
Comments
Seems like a reasonable feature under a flag ( |
With #128 being implemented. Do you think it makes sense for the default to be |
Hmm, I don't have strong opinion. For compatibility reasons we should probably keep it as it was before (don't perform lookup to a parent class). Do you see some other benefits or risks having it enabled/disabled by default? Other question: how do we handle conflicting members appearing in supertypes, like in this example: trait A1 {
val foo: String = ""
}
trait A2 {
val foo: Int = 0
}
class X12 extends A1 with A2
val x12: X12 = new X12
x12.foo // : Int
class X21 extends A2 with A1
val x21: X21 = new X21
x21.foo // : String Will we have to traverse all super types looking for an accessor? This way we would probably have to reimplement Scala's trait linearization, which... may be not worth the effort? |
Thinking about it more, I think not defaulting is I think the compiler already resolves all of that for us by the time we're inspecting members, but I'll have to try it to be sure |
Currently only declarations within the source type is checked. Should we add a config option to increase this scope to parent classes?
The text was updated successfully, but these errors were encountered: