Community
Participate
Working Groups
This class compiles fine with eclipse and generates no warnings or error. Javac gives the following error \A.java:5: a type variable may not be followed by other bounds public static <E, T extends E & Comparable<? super T>> Foo<E> doIt(T t) { ^ public class A { public static <E, T extends E & Comparable<? super T>> Foo<E> doIt(T t) { return null; } interface Foo<E> { boolean ok(E e); } } Im not really sure this is legal code, but if it isn't eclipse should probably mark it as such.
There is no such restriction from the language spec. Closing as javac bug
Reopening. Actually the spec disallow this scenario; though not super clear. See bug 106466
*** This bug has been marked as a duplicate of 106466 ***
Verified in M20060109-0800 for 3.1.2