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

Maurizio Cimadamore maurizio.cimadamore at
Wed Dec 12 11:20:11 UTC 2018

I moved this discussion to compiler-dev, where I think it belongs:


On 10/12/2018 15:43, Maurizio Cimadamore wrote:
> 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)
> Thanks
> Maurizio

More information about the amber-dev mailing list