Apparent generics compilation bug new to Java 1.7

Florian Weimer fweimer at bfk.de
Thu Feb 23 06:46:25 PST 2012


* 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.

-- 
Florian Weimer                <fweimer at bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99



More information about the compiler-dev mailing list