Bug 58715 - [1.5] The return type is incompatible
Summary: [1.5] The return type is incompatible
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-15 14:52 EDT by Johan Compagner CLA
Modified: 2005-01-11 11:02 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 Johan Compagner CLA 2004-04-15 14:52:02 EDT
after installing the latest (cheetah_002) on my eclipse
i get a very strange error:

2	The return type is incompatible with MenuElement.getSubElements(), 
JMenuItem.getSubElements()	TestMenuItem.java

this happens when i try to compile a class that extends jmenuitem and that 
class implements a ActionListener:

class TestMenuItem extends JMenuItem implements ActionListener
Comment 1 Philipe Mulet CLA 2004-04-15 17:00:32 EDT
It probably has to do with the fact we don't yet support covariance.
Comment 2 Johan Compagner CLA 2004-04-15 18:06:48 EDT
but it doesn't change if i compile agains 1.4..
and it gives the error on the class definition and not on a method..
But maybe it is, just wanted to report it.
Comment 3 Philipe Mulet CLA 2004-04-16 06:38:28 EDT
I think I was wrong. I am seeing a similar failure when compiling JDTCore from 
head with the Cheetah... will investigate.

It seems related to using an array type as a return type for a method... 
Comment 4 Philipe Mulet CLA 2004-04-16 07:14:49 EDT
Array types are supposed to be unique, however we seem to incorrectly record 
two instances of them and then they don't compare identical. This occurs in 
conjunction with the array denoting an (unresolved) binary leaf component type.

Reproduced by compiling JDT Core sources using Cheetah, error shows up on 
JavaModelStatuts#getChildren() complaining about incompatible IStatus[] return 
type.
Comment 5 Philipe Mulet CLA 2004-04-16 10:05:12 EDT
Actually the problem comes from the fact that certain binaries are referencing 
themselves. When resolving the ref to IStatus, askForType is indirectly 
creating further array bindings of IStatus, before it has updated the array 
cache.

This bug was introduced when adding support for lazy generic bindings.
Fixed.
Comment 6 Philipe Mulet CLA 2004-04-16 10:05:27 EDT
forgot to assign
Comment 7 Philipe Mulet CLA 2004-04-16 10:05:52 EDT
fixed