Summary: | codeSelect does not resolve correct key for implicit method type arguments | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||
Component: | Core | Assignee: | David Audel <david_audel> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | jerome_lanneluc, Olivier_Thomann, philippe_mulet | ||||
Version: | 3.4 | ||||||
Target Milestone: | 3.5 M1 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Markus Keller
2007-11-13 10:13:12 EST
The SelectionEngine is loosing the return statement: import java.util.Collections; import java.util.List; public class Try { public Try() { } List<String> get(boolean b) { <SelectOnMessageSend:Collections.emptyList()>; } } Thus the inference cannot find out that List<String> should be return. David, please have a look. Inference from expected type (15.12.2.8) is also meant to work with: - field initialization expression - local variable initialization expression - array initialization e.g. for array initializer: public class X { String[] strings = { foo() }; static <T> T foo() { return null; } } Created attachment 108177 [details]
Proposed fix
Released for 3.5M1. Tests added GenericsSelectionTest#test0023() ResolveTests_1_5#test0119() -> test0122() Verified for 3.5M1 using I20080805-1307 |