Bug 104109 - [1.5] compile error in javac but not eclipse
Summary: [1.5] compile error in javac but not eclipse
Status: VERIFIED DUPLICATE of bug 106466
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-15 16:57 EDT by Kasper Nielsen CLA
Modified: 2006-01-10 09:44 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 Kasper Nielsen CLA 2005-07-15 16:57:08 EDT
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.
Comment 1 Philipe Mulet CLA 2005-07-17 04:49:04 EDT
There is no such restriction from the language spec.
Closing as javac bug
Comment 2 Philipe Mulet CLA 2005-10-20 18:58:33 EDT
Reopening. Actually the spec disallow this scenario; though not super clear.
See bug 106466
Comment 3 Philipe Mulet CLA 2005-10-20 18:59:20 EDT

*** This bug has been marked as a duplicate of 106466 ***
Comment 4 Olivier Thomann CLA 2006-01-10 09:44:28 EST
Verified in M20060109-0800 for 3.1.2