INVOKEVIRTUAL fails on interfaces with "Illegal type at constant pool entry"
I am sure there is something wrong with
INVOKEVIRTUAL failing execution within interface methods (static or
<clinit>). The attached unit tests attempts an
INVOKEVIRTUAL call to
System.out.println which fails with message:
java.lang.VerifyError: Illegal type at constant pool entry 23 in class TestInterface3 Exception Details: Location: TestInterface3.test()V @5: invokevirtual Reason: Constant pool index 23 is invalid Bytecode: 0x0000000: b200 0f12 11b6 0017 b1
As a workaround if wrapping the functionality in a static method you can successfully
INVOKESTATIC and pass the
String to the delegate which can perform the instance method calls.
I could be mistaken but I am sure this should work, if not what is the preferred method for invoking instance methods on external classes from within an interface static context?
P.S. I gave creating a merge request a shot but don't appear to have the required permissions, attached find the unit tests for you perusal.