javac improperly accepts the following code.
////////////////////////////////////////////////////
class R<T extends R<T>> {
T f() { return null; }
T t;
void x(R<?> r) {
this.t = r.f().t; // this should be an error!
}
}
////////////////////////////////////////////////////
class R<T extends R<T>> {
T f() { return null; }
T t;
void x(R<?> r) {
this.t = r.f().t; // this should be an error!
}
}
- relates to
-
JDK-5011312 wildcard capture (snapshotting)
- Resolved