Bug when lowering a method ref (concise method)

Remi Forax forax at univ-mlv.fr
Sun Sep 30 13:11:57 UTC 2018


Hi Vicente,
another test case not handled by javac.

public class ConciseMethodRef implements Runnable {
  public void run() -> null;
  
  Runnable f(Runnable r) -> r;
  
  void m() = f(this)::run;
}

An exception has occurred in the compiler (12-amber). 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 and the following diagnostic in your report. Thank you.
java.lang.NullPointerException
	at jdk.compiler/com.sun.tools.javac.tree.TreeMaker.isUnqualifiable(TreeMaker.java:1084)
	at jdk.compiler/com.sun.tools.javac.tree.TreeMaker.QualIdent(TreeMaker.java:699)
	at jdk.compiler/com.sun.tools.javac.comp.Lower.visitMethodDefInternal(Lower.java:2549)
	at jdk.compiler/com.sun.tools.javac.comp.Lower.visitMethodDef(Lower.java:2447)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:879)
	at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
	at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2082)
	at jdk.compiler/com.sun.tools.javac.comp.Lower.visitClassDef(Lower.java:2220)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:780)
	at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
	at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2082)
	at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2101)
	at jdk.compiler/com.sun.tools.javac.comp.Lower.translateTopLevelClass(Lower.java:3850)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1579)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1432)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:973)
	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:311)
	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170)
	at jdk.compiler/com.sun.tools.javac.main.JavacToolProvider.run(JavacToolProvider.java:46)
	at java.base/java.util.spi.ToolProvider.run(ToolProvider.java:137)

Rémi


More information about the amber-dev mailing list