| Summary: | [1.7][compiler] AIOOB on diamond construct with argument error | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 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, Olivier_Thomann | ||||||||
| Version: | 3.7 | ||||||||||
| Target Milestone: | 3.7.1 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
Created attachment 195297 [details]
Proposed patch
Patch under test
Added org.eclipse.jdt.core.tests.compiler.regression.GenericsRegressionTest_1_7.test0029() as a regression test. Created attachment 195299 [details]
Proposed patch
Actually, I like this patch better.
Released in BETA_JAVA7 branch. I meant to fix QAE in a similar manner, but forgot:
Now the following program continues to trigger AIOOB:
public class X {
class I<T> {
I(T t) {}
}
X.I<String> f = new X().new I<>(new Y());
}
Patch will follow shortly.
Created attachment 195460 [details] Additional fix + test This patch addresses QAE. Other subtypes of AllocationExpression will undergo similar change via bug 343693. Verified using v_B65. |
Top of BETA_JAVA7 branch. The following code triggers an AIOOB from the compiler. public class X<T> { X(T t) {} X<String> f = new X<>(new Y()); } (Y needs to be undefined to trigger the error)