-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Missing trait initialisers in certain cases, compared to Scala 2 #10839
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
Tentatively milestoned. |
See #10530, where I left this intentionally "unsolved". (look for "diachronic" in there) |
As I said in the meeting: I can believe there are reasons to do things differently, but that should be for 4.0 ( |
So Scala 3 doesn't add // functional-tests/src/test/trait-pushing-up-concrete-methods-is-nok/v1/A.scala
trait A
trait B extends A {
def foo: Int = 2
}
// functional-tests/src/test/trait-pushing-up-concrete-methods-is-nok/v2/A.scala
trait A {
def foo: Int = 2
}
trait B extends A // functional-tests/src/test/moving-method-upward-from-trait-to-class-nok/v1/A.scala
class A
trait B extends A {
def foo = 2
}
// functional-tests/src/test/moving-method-upward-from-trait-to-class-nok/v2/A.scala
class A {
def foo = 2
}
trait B extends A // functional-tests/src/test/trait-deleting-concrete-methods-is-nok/v1/A.scala
trait A {
def foo: Int
}
trait B extends A {
override def foo: Int = 2
}
class C extends B
// functional-tests/src/test/trait-deleting-concrete-methods-is-nok/v2/A.scala
trait A {
def foo: Int = 2
}
trait B extends A
class C extends B If yes, then great, the new scheme makes such changes compatible. If no, then less good, because while it may make more sense these changes are still incompatible (and adds some diachronic complexity). |
They're unfortunately still incompatible, but not due to |
Thanks for confirming. I'm happy to close this, taking the status quo as "better because it makes more sense" (default methods). |
Minimized code
or
Output
Expectation
Same as Scala 2:
This came from some test cases in MiMa where changes within such hierarchies cause binary incompatibilities. I'd love if they didn't, but I think Scalac 2 has good reason to be the way it is and I believe we don't want to deviate from that in Scala 3. So perhaps this one is a 3.0 blocker...
The text was updated successfully, but these errors were encountered: