1/*
2 * @test /nodynamiccopyright/
3 * @bug 8064464
4 * @summary regression with type inference of conditional expression
5 * @compile/fail/ref=T8064464.out -XDrawDiagnostics T8064464.java
6 */
7
8import java.util.List;
9
10class T8064464 {
11
12  String f(Object o) { return null; }
13  Integer f(int i) { return null; }
14
15  <X extends Integer> X id() { return null; }
16
17  void m(List<Integer> lx) {
18    Integer i1 = f(!lx.isEmpty() ? 0 : lx.get(0)); //ok --> f(int)
19    Integer i2 = f(!lx.isEmpty() ? lx.get(0) : 0); //ok --> f(int)
20    f(!lx.isEmpty() ? id() : 0); // ambiguous
21    f(!lx.isEmpty() ? 0 : id()); // ambiguous
22  }
23}
24