-
Bug
-
Resolution: Duplicate
-
P3
-
6
-
generic
-
generic
no compile-time error should be reported in the example below:
interface Super<P> {}
class Y implements Super<Integer>{}
interface X extends Super<Double>{}
class S<L> extends Y {}
interface T<L> extends X{}
public class Test{
public static void main(String argv[]) {
S s = null; // same if I use S<Byte>
T t = null; // same if I use T<Byte>
t = (T) s; // casting to raw - should be no compile-time error
}
}
there are many other similar situations. (f.e. when S T X Y are all interfaces).
interface Super<P> {}
class Y implements Super<Integer>{}
interface X extends Super<Double>{}
class S<L> extends Y {}
interface T<L> extends X{}
public class Test{
public static void main(String argv[]) {
S s = null; // same if I use S<Byte>
T t = null; // same if I use T<Byte>
t = (T) s; // casting to raw - should be no compile-time error
}
}
there are many other similar situations. (f.e. when S T X Y are all interfaces).
- duplicates
-
JDK-6559182 Cast from a raw type with non-generic supertype to a raw type fails unexpectedly
-
- Closed
-