Bug 113070 - [1.5][compiler] Mixing type variable and reified type is allowed as bound of type variable
Summary: [1.5][compiler] Mixing type variable and reified type is allowed as bound of ...
Status: VERIFIED DUPLICATE of bug 106466
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-19 09:07 EDT by Rémi Forax CLA
Modified: 2006-01-10 09:43 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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