Apparent generics compilation bug new to Java 1.7
Rémi Forax
forax at univ-mlv.fr
Thu Feb 23 06:57:41 PST 2012
On 02/23/2012 03:46 PM, Florian Weimer wrote:
> * Benedict Elliott Smith:
>
>> The below class no longer compiles (1.7.02); I can't see any good reason
>> for it not to, and nor can ecj or the 1.6 JDK, so I think it is quite
>> probably a bug.
> Why are I and I2 interchangeable?
>
>> public class TypeTest {
>> static abstract class A<K, V, I extends B<K, V>, I2 extends B<V, K>> {
>> abstract A<V, K, I2, I> test();
>> }
>> static class B<K, V> {
>> }
>> }
> They have different bounds, so I think you can't swap them.
>
Hi Florian,
It should work, if you take a look closer, the bounds of I and I2 are
swapped too.
Rémi
More information about the compiler-dev
mailing list