Compiling and running the below class throws a verify error:
public class X {
public static void main(String argv[]) {
X test = new X();
}
X() {
class InnerLocal {}
java.util.function.IntSupplier foo = () -> {
new InnerLocal() {}; // This is trouble
return 0;
};
super();
}
}
And the error is:
Error: Unable to initialize main class X
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
X.<init>()V @1: invokedynamic
Reason:
Type uninitializedThis (current frame, stack[0]) is not assignable to 'X'
Current Frame:
bci: @1
flags: { flagThisUninit }
locals: { uninitializedThis }
stack: { uninitializedThis }
Bytecode:
0000000: 2aba 0012 0000 4c2a b700 16b1
Compiling and running the below class throws a verify error:
And the error is: