| Summary: | [1.7][hovering] Show inferred type for Diamond types | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Ayushman Jain <amj87.iitr> | ||||
| Component: | UI | Assignee: | Markus Keller <markus.kell.r> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P2 | CC: | daniel_megert, deepakazad, markus.kell.r, raksha.vasisht | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | 3.7.1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | 351165 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
Ayushman Jain
In comment 0, the inferred type can be seen in the hover of X in new X<>("hello") , since the type variable T in the constructor invocation has been replaced with String. To make the method overloading resolution clear, we already have Mark Occurrences, Open Declaration, and the Javadoc hover on invocations of testFunction(..). But I agree that it would be nice to see the used type arguments right in the constructor hover, e.g. for the new ArrayList<>() invocations here: package diamond; import java.util.*; class Diamond { void foo() { List<String> a= new ArrayList<>(); List<Object> b= new ArrayList<>().subList(1, 2); List<String> c= new ArrayList<String>(); c.subList(1, 2); c.add(""); List<String> d= true ? new ArrayList<>() : new LinkedList<>(); } } Filed bug 351165 for API to fetch the type arguments. I removed the UnionType from this bug, since it is a separate issue that can be tackled in 3.8 when we fix bug 99931. Created attachment 199107 [details]
Fix
Fixed in HEAD and R3_7_maintenance. Forgot to mark as fixed. Verified in M20110824-0800 on Linux. >I removed the UnionType from this bug, Filed bug 355795. |