Bug 100879

Summary: Generic method type inference ignores casts
Product: [Eclipse Project] JDT Reporter: Chris Smith <cdsmith>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 RC4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Chris Smith CLA 2005-06-20 12:31:01 EDT
Casting the result of a generic method is ignored when inferring the value of 
any type parameters.  Other uses of the return value appear to be fine.  For 
example, the following code fails with an error:

    foo((Set<String>) Collections.emptySet());

Whereas this code is fine:

    Set<String> a = Collections.emptySet();
    foo(a);
Comment 1 Philipe Mulet CLA 2005-06-20 13:16:54 EDT
Unfortunately, this isn't a bug; but rather a law imposed by the spec.
So pls blame the spec instead (I would favor considering cast during inference).

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