langtools/test/tools/javac/generics/UncheckedCovariance.java
author sogoel
Fri, 15 May 2015 16:53:42 -0700
changeset 30721 1024d425d97e
parent 30719 91834c070ba5
permissions -rw-r--r--
8074425: Group 13b: golden files for tests in tools/javac/generics dir Reviewed-by: jjg, darcy, mcimadamore

/*
 * @test /nodynamiccopyright/
 * @bug 4949303
 * @summary A method returning a raw type cannot override a method returning a generic type
 * @author gafter
 *
 * @compile  UncheckedCovariance.java
 * @compile/fail/ref=UncheckedCovariance.out -XDrawDiagnostics  -Xlint:unchecked -Werror  UncheckedCovariance.java
 */

class UncheckedCovariance {
    static class Box<T> { }
    static class A {
        Box<Integer> f() { return null; }
    }
    static class B extends A {
        Box f() { return null; }
    }
}