-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P5
-
Affects Version/s: 8, 9
-
Component/s: tools
-
b17
-
Verified
the example below compiles successfully on JDK8b132, but it seems to me that it should fail according to spec.
class Container<U> {
U t;
}
interface Supertype<U> {
}
interface Type1 extends Supertype<Number> {
}
interface Type2 extends Supertype<Integer> {
}
public class Main {
static <U extends Type1> void m(Container<? super U> a) {
}
public static void main(String[] args) {
m(new Container<Type2>());
}
}
class Container<U> {
U t;
}
interface Supertype<U> {
}
interface Type1 extends Supertype<Number> {
}
interface Type2 extends Supertype<Integer> {
}
public class Main {
static <U extends Type1> void m(Container<? super U> a) {
}
public static void main(String[] args) {
m(new Container<Type2>());
}
}
- relates to
-
JDK-8037878 javac should take multiple upper bounds into account in incorporation
-
- Closed
-