Bug 272656

Summary: [1.5][compiler] covariant return types foil quick fix and yield confusing error flag
Product: [Eclipse Project] JDT Reporter: Hollis Waite <hwaite>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, Olivier_Thomann, srikanth_sankaran
Version: 3.2   
Target Milestone: 3.5 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Hollis Waite CLA 2009-04-17 04:45:38 EDT
Build ID: M20090211-1700

Steps To Reproduce:

public class Test {
  interface Interface {Integer getX();}
  class Super {public Object getX() {return null;}}
  class Sub extends Super implements Interface {}
}


More information:
Yields error message "The return type is incompatible with Test.Interface.getX(), Test.Super.getX()".  Typically, a class that is missing methods will allow for a "make abstract" or "add missing methods" quick fix.  If one return type is a more specific version of the other(s), it could be provided as an option?  Otherwise, the error message should at least indicate which method is causing the problem.
Comment 1 Kent Johnson CLA 2009-04-20 15:48:58 EDT
Please try a more recent build.

When I try this case, I get 1 problem on the type Test.Sub that says:

The type Test.Sub must implement the inherited abstract method Test.Interface.getX() to override Test.Super.getX()
Comment 2 Jay Arthanareeswaran CLA 2009-04-28 06:49:48 EDT
Verified for 3.5M7 using build I20090426-2000