Here's the affected testcase, which is a slightly modified version from #2936 :
record Record<T extends Short>(T t) {}
public class X {
public static <T extends Short> short foo(Record<T> s) {
return switch (s) {
case Record(short s1) -> s1;
default -> 0;
};
}
public static void main(String[] args) {}
}
Running this with the latest from BETA_JAVA23 crashes with the following:
Error: Unable to initialize main class X
Caused by: java.lang.VerifyError: Inconsistent stackmap frames at branch target 62
Exception Details:
Location:
X.foo(LRecord;)S @52: goto
Reason:
Current frame's stack size doesn't match stackmap.
Current Frame:
bci: @52
flags: { }
locals: { 'Record', 'Record', integer }
stack: { }
Stackmap Frame:
bci: @62
flags: { }
locals: { 'Record', 'Record', integer }
stack: { 'java/lang/Short' }
Here's the affected testcase, which is a slightly modified version from #2936 :
Running this with the latest from BETA_JAVA23 crashes with the following: