test/langtools/tools/javac/generics/UncheckedCovariance.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 30719 langtools/test/tools/javac/generics/UncheckedCovariance.java@91834c070ba5
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse

/*
 * @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; }
    }
}