change in inference of unchecked calls after JDK-8147493

Liam Miller-Cushon cushon at
Tue Jan 26 04:03:14 UTC 2016

The fix for JDK-8147493 (regression when type-checking unchecked method
calls) prevents the following code from compiling. It is accepted by 8, and
earlier versions of 9-dev. The return type of w(...) is now being inferred
as S<Q<Object>>. Shouldn't the unchecked call cause return types to be

abstract class Test {

 interface R<E> {}
 interface Q<T> {}
 interface T { <E> Q<E> n(R<E> r); }
 abstract <T> T isA(Class<T> t);
 abstract <T> S<T> w(T t);
 interface S<T> { S<T> t(T value); }

 void f(T t, Q<String> q) {

error: incompatible types: Q<String> cannot be converted to Q<Object>

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

More information about the compiler-dev mailing list