Inference bug in javac: Was: enhanced enums - back from the dead?

Maurizio Cimadamore maurizio.cimadamore at
Mon Dec 10 15:43:11 UTC 2018

On 08/12/2018 12:19, forax at wrote:
> What i mean is that if you run this code, it throws a CCE, because a String is not comparable to an Integer,
> i believe there is a bug in javac (or the JLS) because with Foo<T extends Comparable<T>> , Foo<?>::t is Object & Comparable<?> & Serializable but then Comparator::comparing should not compile because you can not capture the '?' of Comparable to a <U extends Comparable<U>> as required by Comparator::comparing.
I'll take another look at this, and try to reproduce w/o enums (should 
be possible)


More information about the amber-dev mailing list