-
Notifications
You must be signed in to change notification settings - Fork 14
-Xgen-mixin-forwarders
crashes for default methods
#210
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
maybe something to fix for RC1..? |
For reference: in M4 we add the interface as a direct parent during code gen when emitting a super call to a default method: https://github.com/scala/scala/blob/v2.12.0-M4/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala#L1083-L1084 In a later commit this information ("late interfaces") was also encoded in the ClassBType: scala/scala@3fca034 All of this was removed (for M5) when we changed the encoding to emit static methods for trait methods, super calls would directly target the static method (scala/scala@7d51b3f). A super call to a java-defined default method is now only allowed if the interface is a direct parent, this is checked during Mixins (scala/scala@7d51b3f#diff-8b2a191e6261b31a9a6462e4a01d3b9cR351). The |
Here's an example that crashes without the A.java: interface A {
default int m() { return 1; }
} Test.scala class B extends A { override def m = 2 }
trait T extends A
class C extends B with T {
override def m = super[T].m // should invoke A.m
} The To translate the static binding This example is the same as in #143 (comment) but with of a Java-defined interface A instead of a superclass A. In this case, there also isn't a static method |
crashes the compiler with
-Xgen-mixin-forwarders
:The text was updated successfully, but these errors were encountered: