Change in inference behaviour after JDK-8078093

Liam Miller-Cushon cushon at
Fri Jan 15 19:48:26 UTC 2016

It reproduces in jdk9-dev at head, and bisects to the fix for JDK-8078093
[1][2]. Earlier versions of javac do not report the error. Is this a bug?

=== ===
abstract class Test {
  interface One {}
  interface Two<I extends One> { I get(); }
  interface Three<T> {}
  interface Four<T> {}

  <E extends Two<?>, L extends Three<E>> Four<L> f(Class raw, E
destination) {
    return g(raw, destination.get());

  abstract <I extends One, E extends Two<I>, L extends Three<E>> Four<L> g(
      Class<L> labelClass, I destinationId);

$ javac
error: incompatible types: inference variable I has incompatible bounds
    return g(raw, destination.get());
    equality constraints: CAP#1
    lower bounds: One
  where I,E,L are type-variables:
    I extends One declared in method <I,E,L>g(Class<L>,I)
    E extends Two<I> declared in method <I,E,L>g(Class<L>,I)
    L extends Three<E> declared in method <I,E,L>g(Class<L>,I)
  where CAP#1 is a fresh type-variable:
    CAP#1 extends One from capture of ?
1 error

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the compiler-dev mailing list