Details
-
Sub-task
-
Resolution: Fixed
-
P3
-
8
-
None
-
b110
-
generic
-
generic
Description
function func(x) {
switch(x) {
case 8: break; case true:
}
}
results in ClassCastException in code gen.
Exception in thread "main" java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Integer
at jdk.nashorn.internal.codegen.CodeGenerator.enterSwitchNode(CodeGenerator.java:1835)
at jdk.nashorn.internal.ir.SwitchNode.accept(SwitchNode.java:103)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LexicalContextStatement.accept(LexicalContextStatement.java:53)
at jdk.nashorn.internal.ir.SwitchNode.accept(SwitchNode.java:38)
at jdk.nashorn.internal.ir.Node.accept(Node.java:291)
at jdk.nashorn.internal.ir.Block.accept(Block.java:143)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.Block.accept(Block.java:361)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:297)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:46)
[... frames deleted...]
switch(x) {
case 8: break; case true:
}
}
results in ClassCastException in code gen.
Exception in thread "main" java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Integer
at jdk.nashorn.internal.codegen.CodeGenerator.enterSwitchNode(CodeGenerator.java:1835)
at jdk.nashorn.internal.ir.SwitchNode.accept(SwitchNode.java:103)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LexicalContextStatement.accept(LexicalContextStatement.java:53)
at jdk.nashorn.internal.ir.SwitchNode.accept(SwitchNode.java:38)
at jdk.nashorn.internal.ir.Node.accept(Node.java:291)
at jdk.nashorn.internal.ir.Block.accept(Block.java:143)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.Block.accept(Block.java:361)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:297)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:46)
[... frames deleted...]