Bug 123390

Summary: Type inference does not work correctly with wildcards
Product: [Eclipse Project] JDT Reporter: Christian Plesner Hansen <stderr>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1.1   
Target Milestone: 3.1.2   
Hardware: All   
OS: All   
Whiteboard:

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 ***