Bug 114304 - [1.5][compiler] Return type not compatible with generic subinterface.
Summary: [1.5][compiler] Return type not compatible with generic subinterface.
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1.2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-29 16:52 EDT by Steven Coco CLA
Modified: 2006-01-09 11:09 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 Steven Coco CLA 2005-10-29 16:52:09 EDT
Hello.


I recently had inadvertently made reference to a static nested type through a
subinterface inheriting this type.  While this is not illegal, it was a mis-type
on my part.  It turns out the compiler -- at least the one that is drawing the
error annotations in the editor -- thinks this is an error.  But it actually
only happens with a particular typing hierarchy.  I have constructed the seeming
minimal example:

interface A {

    A.I i();

    interface I { }

}

interface B<T> extends A { }

interface C extends B<Object> {

    C.I i();

    interface I extends B.I { }

}

The compiler complains that C.i() is incompatible with A.i().  [This is the bug.]

But, if you modify the above so that B is not generic -- and C invokes no
parameters on B -- then the compiler does not complain.


Thanks!
Steev Coco.
Comment 1 Olivier Thomann CLA 2005-11-01 10:39:21 EST
Reproduced with HEAD.
Comment 2 Philipe Mulet CLA 2005-11-02 08:58:42 EST
Problem comes from supertype of C.I; if making it be: A.I instead of B.I, then
things work ok. The indirect case doesn't work properly.

Comment 3 Philipe Mulet CLA 2005-11-02 09:09:26 EST
Added GenericTypeTest#test860-865.
Comment 4 Philipe Mulet CLA 2005-11-03 15:22:47 EST
Fix released in 3.1.2 stream. Will release in HEAD (3.2) once M3 is declared.
Comment 5 Olivier Thomann CLA 2005-12-13 10:22:02 EST
Verified for 3.2M4 in I20051212-2000
Comment 6 Olivier Thomann CLA 2006-01-09 11:09:56 EST
Verified for 3.1.2 in M20060109-0800.