1 /*
2  * @test /nodynamiccopyright/
3  * @bug 4949303
4  * @summary A method returning a raw type cannot override a method returning a generic type
5  * @author gafter
6  *
7  * @compile  UncheckedCovariance.java
8  * @compile/fail/ref=UncheckedCovariance.out -XDrawDiagnostics  -Xlint:unchecked -Werror  UncheckedCovariance.java
9  */
10 
11 class UncheckedCovariance {
12     static class Box<T> { }
13     static class A {
f()14         Box<Integer> f() { return null; }
15     }
16     static class B extends A {
f()17         Box f() { return null; }
18     }
19 }
20