Bug 272656 - [1.5][compiler] covariant return types foil quick fix and yield confusing error flag
Summary: [1.5][compiler] covariant return types foil quick fix and yield confusing err...
Status: VERIFIED WORKSFORME
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.5 M7   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-17 04:45 EDT by Hollis Waite CLA
Modified: 2009-04-28 09:33 EDT (History)
3 users (show)

See Also:


Attachments

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