| Summary: | [1.7][compiler] Eclipse fails to compile diamond usage | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Srikanth Sankaran <srikanth_sankaran> |
| Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> |
| Status: | VERIFIED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | amj87.iitr, jarthana, Olivier_Thomann, satyam.kandula |
| Version: | 3.7 | ||
| Target Milestone: | 3.7.1 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
I'll follow up. Problem stems from eclipse's underlying failure
to compile this code:
class C {}
interface I {}
public class X<T extends C & I> {
static <U extends C & I> X<U> getX() {
return null;
}
X f2 = getX();
}
See that javac 5 & 6 reject this code as well with:
X.java:8: type parameters of <U>X<U> cannot be determined; no unique maximal ins
tance exists for type variable U with upper bounds C,I
X f2 = getX();
^
7b138 compiles it alright. Under investigation.\
Released disabled junit via org.eclipse.jdt.core.tests.compiler.regression.GenericsRegressionTest_1_7._test0030() See also that eclipse fails to compile the following:
class C {}
interface I {}
public class X<T extends C & I> {
static <U extends C & I> X<U> getX() {
return null;
}
X<?> f2 = getX();
}
while javac 5,6,7 all compile it alright.
Same as bug 341795 *** This bug has been marked as a duplicate of bug 341795 *** Verified using Java 7 feature patch. |
Top of BETA_JAVA7 branch: class C {} interface I {} public class X<T extends C & I> { X() {} X f = new X<>(); } This code doesn't compile with eclipse, JDK7b138 compiles it OK.