Bug 80735

Summary: [1.5] TypeVariable cannot extends TypeVariable
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Olivier Thomann CLA 2004-12-10 17:12:49 EST
According to 4.4, the extends part of a TypeVariable has to be a
ClassOrInterfaceType (is not a TypeVariable).
public class X<U, V extends U> {}

should not compile.
Using javac 1.5, this code compiles fine.

If you add one more bound, it doesn't work anymore.

public class X<U, V, W extends U&V> {}

javac reports:
X.java:1: a type variable may not be followed by other bounds

Eclipse compiles both cases
public class X<U, V, W extends U&V> {}
Comment 1 Kent Johnson CLA 2005-01-14 16:04:35 EST
Actually with this case:
  public class X<U, V, W extends U&V> {}

we report: 'The type V is not an interface; it cannot be specified as a 
bounded parameter'

Since javac accepts this case:
  public class X<U, V extends U> {}

I think we need to continue to accept it.