Description
Assuming a class A with a method foo() and a class B subclass of A. If an invoke opcode references the method B.foo() then the bytecode verifier raises an error with the following error message:
Referenced method 'foo' with expected signature '()void' not found in class 'B'. The native verifier does allow the method to be declared in some superinterface, which the Java Virtual Machine Specification, Second Edition does not.
I can't find where in the Java Virtual Machine Specification, Second Edition this restriction is defined.
The verification of the bytecode generated by the following code fails:
public class TestLegalInvokeInterface01{ public static void test1(Interface01 t){ t.run(); } } interface Interface01 extends Runnable { }