Bug 90147

Summary: Faulty compile errors in generics since 3.1 M6
Product: [Eclipse Project] JDT Reporter: anuhertsa
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: major    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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