Bug 90147 - Faulty compile errors in generics since 3.1 M6
Summary: Faulty compile errors in generics since 3.1 M6
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 3.1 M7   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-04 08:45 EDT by anuhertsa CLA
Modified: 2005-04-04 19:18 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description anuhertsa CLA 2005-04-04 08:45:53 EDT
Since Eclipse 3.1 M6 code like the following won't compile anymore:

public class Test<T extends Object> {
  public class InnerClass implements Comparable<T> {
    public int compareTo(T other) {
      return -1;
    }
  }
  
  public static void main(String[] args) {
    InnerClass a = new InnerClass();
    InnerClass b = new InnerClass();
    // The following line does not compile (anymore):
    a.compareTo(b);
  }
}
Comment 1 Olivier Thomann CLA 2005-04-04 10:53:36 EDT
This code doesn't compile with javac.
Comment 2 Philipe Mulet CLA 2005-04-04 19:18:36 EDT
Indeed, this code shouldn't be accepted.
We tightened semantics since M4.
Added negative test: GenericTypeTest#test570