Bug 76780 - [model] return type not recognized correctly on some generic methods
Summary: [model] return type not recognized correctly on some generic methods
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M3   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-21 19:27 EDT by Jing Xue CLA
Modified: 2004-11-04 10:20 EST (History)
0 users

See Also:


Attachments
Proposed fix (1.35 KB, patch)
2004-11-03 09:25 EST, Jerome Lanneluc CLA
no flags Details | Diff
Proposed regression test (4.38 KB, patch)
2004-11-03 09:25 EST, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jing Xue CLA 2004-10-21 19:27:24 EDT
This is 3.1 M2.

Given the following interface and class:

public interface Interface
{
    public <T extends Interface> T[] foo(Class<T> c);
}

public class Impl implements Interface
{
    public <T extends Interface> T[] foo(Class<T> c)
                                     ~~~~~~~~~~~~~~~
    {
        return null;
    }
}

The editor underlines the implementation method (as shown above) and complains
"The return type is incompatible with Interface.foo(Class<T>)".  However the
Problems View does not show the error, and this code compiles successfully on
command line.
Comment 1 Jerome Lanneluc CLA 2004-10-22 04:47:49 EDT
Suspecting SourceTypeConverter that doesn't recreate the correct ast.
Comment 2 Jerome Lanneluc CLA 2004-11-03 07:37:24 EST
Problem is in SourceTypeConverter#createTypeParameter(...) that doesn't set the
type field on the TypeParameter.
Comment 3 Jerome Lanneluc CLA 2004-11-03 09:25:10 EST
Created attachment 15600 [details]
Proposed fix
Comment 4 Jerome Lanneluc CLA 2004-11-03 09:25:33 EST
Created attachment 15601 [details]
Proposed regression test
Comment 5 Philipe Mulet CLA 2004-11-03 16:26:23 EST
Ok for including in M3
Comment 6 Jerome Lanneluc CLA 2004-11-04 05:35:16 EST
Released proposed patch and regression test.
Comment 7 Frederic Fusier CLA 2004-11-04 10:20:38 EST
Verified for 3.1 M3 with build I200411040010 + jdt.core HEAD