Bug 113070

Summary: [1.5][compiler] Mixing type variable and reified type is allowed as bound of type variable
Product: [Eclipse Project] JDT Reporter: Rémi Forax <forax>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.1.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Rémi Forax CLA 2005-10-19 09:07:54 EDT
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
Comment 1 Philipe Mulet CLA 2005-10-20 03:00:10 EDT
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 ***
Comment 2 Philipe Mulet CLA 2005-10-20 18:53:25 EDT
Actually, after clarification, the spec indeed does disallow this scenario.
Comment 3 Olivier Thomann CLA 2006-01-10 09:43:15 EST
Verified in M20060109-0800 for 3.1.2