blob: 388f5d6f38f0788280d1426d8fcc32997f6f590f [file] [log] [blame]
/*
* @test /nodynamiccopyright/
* @bug 8064464
* @summary regression with type inference of conditional expression
* @compile/fail/ref=T8064464.out -XDrawDiagnostics T8064464.java
*/
import java.util.List;
class T8064464 {
String f(Object o) { return null; }
Integer f(int i) { return null; }
<X extends Integer> X id() { return null; }
void m(List<Integer> lx) {
Integer i1 = f(!lx.isEmpty() ? 0 : lx.get(0)); //ok --> f(int)
Integer i2 = f(!lx.isEmpty() ? lx.get(0) : 0); //ok --> f(int)
f(!lx.isEmpty() ? id() : 0); // ambiguous
f(!lx.isEmpty() ? 0 : id()); // ambiguous
}
}