2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2015-05-15 16:53:08 +00:00
|
|
|
* @test /nodynamiccopyright/
|
2007-12-01 00:00:00 +00:00
|
|
|
* @bug 4949303
|
|
|
|
* @summary A method returning a raw type cannot override a method returning a generic type
|
|
|
|
* @author gafter
|
|
|
|
*
|
2009-05-28 05:34:43 +00:00
|
|
|
* @compile UncheckedCovariance.java
|
2015-05-15 16:53:08 +00:00
|
|
|
* @compile/fail/ref=UncheckedCovariance.out -XDrawDiagnostics -Xlint:unchecked -Werror UncheckedCovariance.java
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
class UncheckedCovariance {
|
|
|
|
static class Box<T> { }
|
|
|
|
static class A {
|
|
|
|
Box<Integer> f() { return null; }
|
|
|
|
}
|
|
|
|
static class B extends A {
|
|
|
|
Box f() { return null; }
|
|
|
|
}
|
|
|
|
}
|