Community
Participate
Working Groups
The JLS is not clear if this case is or not allowed (see section 4.4). Eclipse compiler allow it but javac reject it. TypeVariableBounds .java : public class TypeVariableBounds { public <U,T extends U & Cloneable> void m(T t) { // eclipse ok } } $javac -d ../classes TypeVariableBounds.java TypeVariableBounds.java:3: a type variable may not be followed by other bounds public <U,T extends U & Cloneable> void m(T t) { ^ 1 error Rémi Forax
The spec doesn't disallow it, and since the grammar describes it; it seems a javac limitation. *** This bug has been marked as a duplicate of 106466 ***
Actually, after clarification, the spec indeed does disallow this scenario.
Verified in M20060109-0800 for 3.1.2