Up to Java 24 we can override default members of both direct and indirect superinterfaces.
As example, these classes in Java:
public interface A {
default String getValue() {
return "1";
}
}
public interface B extends A {
}
Can be extended in Jython:
class X(A):
def getValue(self):
return "2"
class Y(B):
def getValue(self):
return "3"
In Java 25 the JVM allows invokespecial on a default method only if that interface is a direct superinterface.
Therefore the class X above works, but when I try to evaluate class Y I get:
java.lang.VerifyError: Bad invokespecial instruction: interface method to invoke is not in a direct superinterface.
As a workaround, I can inherit the base interface explicitly too:
class Y(B, A):
def getValue(self):
return "3"
But a proper fix in Jython would be greatly appreciated.
Up to Java 24 we can override default members of both direct and indirect superinterfaces.
As example, these classes in Java:
public interface A { default String getValue() { return "1"; } } public interface B extends A { }Can be extended in Jython:
class X(A): def getValue(self): return "2" class Y(B): def getValue(self): return "3"In Java 25 the JVM allows invokespecial on a default method only if that interface is a direct superinterface.
Therefore the class X above works, but when I try to evaluate class Y I get:
java.lang.VerifyError: Bad invokespecial instruction: interface method to invoke is not in a direct superinterface.
As a workaround, I can inherit the base interface explicitly too:
class Y(B, A): def getValue(self): return "3"But a proper fix in Jython would be greatly appreciated.