-
Bug
-
Resolution: Fixed
-
P3
-
17, 18
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8274906 | 17.0.2 | Ekaterina Vergizova | P3 | Resolved | Fixed | b03 |
ADDITIONAL SYSTEM INFORMATION :
openjdk 17-ea 2021-09-14
OpenJDK Runtime Environment (build 17-ea+27-2476)
OpenJDK 64-Bit Server VM (build 17-ea+27-2476, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
Currently, it is not compiling source code with "switch(null)" and with `--enable-preview --release 17`
ACTUAL -
An exception has occurred in the compiler (17-ea). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.AssertionError: unexpected type: <nulltype>
at jdk.compiler/com.sun.tools.javac.tree.TreeMaker.Type(TreeMaker.java:860)
at jdk.compiler/com.sun.tools.javac.tree.TreeMaker.VarDef(TreeMaker.java:882)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.handleSwitch(TransPatterns.java:383)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.visitSwitchExpression(TransPatterns.java:263)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitchExpression.accept(JCTree.java:1380)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.visitVarDef(TransPatterns.java:729)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1027)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.visitBlock(TransPatterns.java:684)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.visitMethodDef(TreeTranslator.java:150)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.visitMethodDef(TransPatterns.java:631)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:921)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:70)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.visitClassDef(TreeTranslator.java:139)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.visitClassDef(TransPatterns.java:711)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:819)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.translateTopLevelClass(TransPatterns.java:740)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1535)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1408)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:946)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:317)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:176)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)
---------- BEGIN SOURCE ----------
public class Foo{
public static void main(String[] args){
switch (null){default:}
}
}
---------- END SOURCE ----------
FREQUENCY : always
openjdk 17-ea 2021-09-14
OpenJDK Runtime Environment (build 17-ea+27-2476)
OpenJDK 64-Bit Server VM (build 17-ea+27-2476, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
Currently, it is not compiling source code with "switch(null)" and with `--enable-preview --release 17`
ACTUAL -
An exception has occurred in the compiler (17-ea). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.AssertionError: unexpected type: <nulltype>
at jdk.compiler/com.sun.tools.javac.tree.TreeMaker.Type(TreeMaker.java:860)
at jdk.compiler/com.sun.tools.javac.tree.TreeMaker.VarDef(TreeMaker.java:882)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.handleSwitch(TransPatterns.java:383)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.visitSwitchExpression(TransPatterns.java:263)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitchExpression.accept(JCTree.java:1380)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.visitVarDef(TransPatterns.java:729)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1027)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.visitBlock(TransPatterns.java:684)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1091)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.visitMethodDef(TreeTranslator.java:150)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.visitMethodDef(TransPatterns.java:631)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:921)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:70)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.visitClassDef(TreeTranslator.java:139)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.visitClassDef(TransPatterns.java:711)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:819)
at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
at jdk.compiler/com.sun.tools.javac.comp.TransPatterns.translateTopLevelClass(TransPatterns.java:740)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1535)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1408)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:946)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:317)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:176)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)
---------- BEGIN SOURCE ----------
public class Foo{
public static void main(String[] args){
switch (null){default:}
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8274906 Javac throws when compiling switch (null)
-
- Resolved
-
- duplicates
-
JDK-8270153 Compile-time AssertionError in pattern switch statement on null
-
- Closed
-
- links to
-
Commit openjdk/jdk17u/14e6913a
-
Commit openjdk/jdk/18870284
-
Review openjdk/jdk17u/159
-
Review openjdk/jdk/4679
-
Review openjdk/jdk/5713
(2 links to)