| Summary: | [1.5][compiler] Cast type shouldn't be used in generic method argument inference | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Philipe Mulet <philippe_mulet> |
| Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | thanson |
| Version: | 3.1 | ||
| Target Milestone: | 3.1 RC2 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Credits for finding this defect go to Tim Hanson. Added GenericTypeTest#test704. Impacted other existing tests (171&396). Fix is to stop setting expected type in CastExpressions. Fixed Verified for 3.1 RC2 using build N20050607-0010 + JDT/Core HEAD Verified for 3.1 RC2 using build I20050610-0010 |
3.1rc1 This should fail: import java.util.*; public class Y { public static void main(String[] args) { List<String> l = (List<String>)Collections.emptyList(); } } Generic method invocation only looks at the expected type when in the context of Assignment Conversion, not Casting Conversion.