2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2014-06-05 10:44:38 -07:00
|
|
|
* @test /nodynamiccopyright/
|
2007-12-01 00:00:00 +00:00
|
|
|
* @bug 5064736
|
|
|
|
* @summary Incompatible types are cast without error
|
2014-06-05 10:44:38 -07:00
|
|
|
* @compile/fail/ref=T5064736.out -XDrawDiagnostics T5064736.java
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class T5064736 {
|
|
|
|
class A {}
|
|
|
|
class B extends A {}
|
|
|
|
|
|
|
|
public class Foo<T> {
|
|
|
|
public <U extends B> void foo(Foo<? super A> param) {
|
|
|
|
Foo<U> foo = (Foo<U>)param;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|