(original) (raw)

Hi all,

looks like the code should not compile
public class MyTest {
public static void main(String\[\] args) {
Supplier stringSupplier = switch (args.length) {
default -> {
}
};
}
}

At least running the class I get verify error:

Exception in thread "main" java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
org/jetbrains/MyTest.main(\[Ljava/lang/String;)V @12: aload\_2
Reason:
Type top (current frame, locals\[2\]) is not assignable to reference type
Current Frame:
bci: @12
flags: { }
locals: { '\[Ljava/lang/String;' }
stack: { }
Bytecode:
0000000: 2abe ab00 0000 000a 0000 0000 2c4c b1
Stackmap Table:
same\_frame(@12)

at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:325)
at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:107)

Thanks,
Anna