Bug 123390 - Type inference does not work correctly with wildcards
Summary: Type inference does not work correctly with wildcards
Status: RESOLVED DUPLICATE of bug 112268
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.1.2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-11 02:45 EST by Christian Plesner Hansen CLA
Modified: 2006-01-11 07:16 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 Christian Plesner Hansen CLA 2006-01-11 02:45:29 EST
This method is legal according to the JLS (15.12.2.8) and compiles with 3.1.0:

  public List<? extends String> getList() {
    return Collections.emptyList();
  }

In 3.1.1 build M20050929-0840 it gives the following error:

  Type mismatch: cannot convert from List<Object> 
    to List<? extends String>

If the method returns List<String> there is no problem.
Comment 1 Philipe Mulet CLA 2006-01-11 07:16:32 EST
This is a dup, and got fixed in 3.1.2 update.

*** This bug has been marked as a duplicate of 112268 ***