Java 8 language spec flaw/bug

Maurizio Cimadamore maurizio.cimadamore at
Fri Aug 22 16:42:55 UTC 2014

On 22/08/14 16:28, Davin McCall wrote:
> static <T>  T foo(Class<T>  clazz)
>        static  <U>  U ternary(boolean  cond,  U a,  U b)
>        foo(ternary(true, String.class, StringBuilder.class));
This _does_ compile (at least it does in 9) and it is a very different 
example from the one quoted in the bug you mentioned [1], which has 
Class<U> as formals, not just bare U as here.

[1] -

More information about the lambda-dev mailing list