| Summary: | [1.7][compiler] Prohibit use of <> with explicit type arguments to generic constructor | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Srikanth Sankaran <srikanth_sankaran> | ||||
| Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | amj87.iitr, raksha.vasisht | ||||
| Version: | 3.7 | Flags: | amj87.iitr:
review+
|
||||
| Target Milestone: | 3.7.1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Srikanth Sankaran
Created attachment 195184 [details]
Proposed patch + tests
This patch also simplifies the implementation of Scope.getStaticFactory().
All tests pass. Released in BETA_JAVA7 branch. Ayush, please review along with the <> implementation's review. TIA. Patch looks good. Just one small comment:
Is there any reason for checking of this case in both AllocationExp and QualifiedAllocExp AFTER the type arguments have been resolved and it has been ascertained whether there is an error or not?
The argHasError set when an error is found in resolution is only processed after the place where the new warning is reported and null is returned. So, in cases where I use an invalid syntax such
new <Blah> X<>("")
maybe it'll be better to just ascertain at the beginning that this is an invalid syntax and report the new warning and not go ahead and try resolve Blah. I'm not sure though if it has other side effects.
(In reply to comment #3) > maybe it'll be better to just ascertain at the beginning that this is an > invalid syntax and report the new warning and not go ahead and try resolve > Blah. I'm not sure though if it has other side effects. The compiler's strategy in general is go ahead and report as many orthogonal problems as it can while avoiding secondary errors i.e errors that arise due to inadequate repair from the primary error. In this case, this would indeed be the case. +1 then Verified. |