Adam Sotona ed4b801771 8238735: NPE compiling lambda expression within conditional expression
The fix saves result type from the first pass through the Attr.visitLambda and returns it after recovery pass to avoid NPE caused by exposure of Type.recoveryType

Reviewed-by: mcimadamore
2020-06-17 13:18:19 +02:00

14 lines
329 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8238735
* @summary javac should fail without throwing NPE
* @compile/fail/ref=T8238735.out -XDrawDiagnostics T8238735.java
*/
class T8238735 {
public static void main(String[] args) {
boolean first = true;
first = first ? false : (boolean)(() -> false) ;
}
}