-
Bug
-
Resolution: Cannot Reproduce
-
P5
-
5.0
-
generic
-
generic
In this program, only cast 3 should be rejected:
import java.util.List;
public class X<S extends Comparable<S>> {
Object foo(Comparable<Integer> c) {
return (Comparable<S>) c; // 1
}
<U extends Throwable, V extends Runnable> void foo(List<V> lv) {
List l = (List<U>) lv; // 2
}
<U extends Throwable, V extends Runnable> void foo2(List<List<V>> lv) {
List l = (List<List<U>>) lv; // 3
}
}
###@###.### 2005-05-13 15:51:12 GMT
import java.util.List;
public class X<S extends Comparable<S>> {
Object foo(Comparable<Integer> c) {
return (Comparable<S>) c; // 1
}
<U extends Throwable, V extends Runnable> void foo(List<V> lv) {
List l = (List<U>) lv; // 2
}
<U extends Throwable, V extends Runnable> void foo2(List<List<V>> lv) {
List l = (List<List<U>>) lv; // 3
}
}
###@###.### 2005-05-13 15:51:12 GMT
- relates to
-
JDK-6557279 Tweak provable distinctness
- Closed
-
JDK-4916620 legal cast is rejected
- Closed
-
JDK-6790039 overhaul cast-conversion (umbrella)
- Closed
-
JDK-6932571 Compiling Generics causing Inconvertible types
- Closed
-
JDK-6507317 Problem when casting from parametrized type to concrete class
- Closed