Bug 100879 - Generic method type inference ignores casts
Summary: Generic method type inference ignores casts
Status: RESOLVED DUPLICATE of bug 100271
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1 RC4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-20 12:31 EDT by Chris Smith CLA
Modified: 2005-06-20 13:17 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***