The attached code throws java.lang.VerifyError exception. The output is as follows:
Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
Factory3.create(LMyClass;)LFactory3; @13: invokedynamic
Reason:
Type 'MyClass' (current frame, stack[3]) is not assignable to 'Factory3'
Current Frame:
bci: @13
flags: { }
locals: { 'MyClass' }
stack: { uninitialized 0, uninitialized 0, 'MyClass2', 'MyClass' }
Bytecode:
0000000: bb00 0159 bb00 0259 2ab7 0003 2aba 0004
0000010: 0000 b700 05b0
at VmIssue$1.lambda$0(VmIssue.java:6)
at VmIssue$1$$Lambda$2.myCreate(Unknown Source)
at VmIssue.lambda$1(VmIssue.java:9)
at VmIssue$$Lambda$1.add(Unknown Source)
at VmIssue$1.create(VmIssue.java:6)
at VmIssue.main(VmIssue.java:8)
The problem is reproduced on:
- JDK 8 builds 66, 68;
- JDK lambda repo, build 68;
The tests are not in the repo yet but they will fail.
Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
Factory3.create(LMyClass;)LFactory3; @13: invokedynamic
Reason:
Type 'MyClass' (current frame, stack[3]) is not assignable to 'Factory3'
Current Frame:
bci: @13
flags: { }
locals: { 'MyClass' }
stack: { uninitialized 0, uninitialized 0, 'MyClass2', 'MyClass' }
Bytecode:
0000000: bb00 0159 bb00 0259 2ab7 0003 2aba 0004
0000010: 0000 b700 05b0
at VmIssue$1.lambda$0(VmIssue.java:6)
at VmIssue$1$$Lambda$2.myCreate(Unknown Source)
at VmIssue.lambda$1(VmIssue.java:9)
at VmIssue$$Lambda$1.add(Unknown Source)
at VmIssue$1.create(VmIssue.java:6)
at VmIssue.main(VmIssue.java:8)
The problem is reproduced on:
- JDK 8 builds 66, 68;
- JDK lambda repo, build 68;
The tests are not in the repo yet but they will fail.