-
Bug
-
Resolution: Fixed
-
P4
-
7
This somewhat confusing code result in a bound error. It passed as of recent builds.
------FBoundedColorPoint.java-----------------
public class FBoundedColorPoint
{
class AbstractPoint<T extends AbstractPoint<T>> {
int x, y;
boolean equals(T that) { return (this.x == that.x) && (this.y == that.y); }
}
class Point extends AbstractPoint<Point> { }
public FBoundedColorPoint() {
AbstractPoint<? super Point> con; // <<pass>>
}
}
---------------
This test case I though was in the regression test set, so maybe it was removed(?) and so I gave it rather low priority. The error message is:
FBoundedColorPoint.java:12: type parameter capture#716 of ? super FBoundedColorPoint.Point is not within its bound
AbstractPoint<? super Point> con; // <<pass>>
^
1 error
------FBoundedColorPoint.java-----------------
public class FBoundedColorPoint
{
class AbstractPoint<T extends AbstractPoint<T>> {
int x, y;
boolean equals(T that) { return (this.x == that.x) && (this.y == that.y); }
}
class Point extends AbstractPoint<Point> { }
public FBoundedColorPoint() {
AbstractPoint<? super Point> con; // <<pass>>
}
}
---------------
This test case I though was in the regression test set, so maybe it was removed(?) and so I gave it rather low priority. The error message is:
FBoundedColorPoint.java:12: type parameter capture#716 of ? super FBoundedColorPoint.Point is not within its bound
AbstractPoint<? super Point> con; // <<pass>>
^
1 error
- relates to
-
JDK-6450691 Wrong capture of a ?-extends wildcard with a ?-super wildcard as bound
- Closed
-
JDK-6557733 Problem with bounds and wildcards
- Closed
-
JDK-6526842 another type system loophole in wildcard substitution
- Closed
-
JDK-6651719 Compiler crashes possibly during forward reference of TypeParameter
- Closed
-
JDK-6676045 StackOverFlowError during instantiation of generic type
- Closed