test/langtools/tools/javac/generics/UncheckedCovariance.java
author darcy
Thu, 12 Jul 2018 14:13:15 -0700
changeset 51047 860a3648c494
parent 47216 71c04702a3d5
permissions -rw-r--r--
8028563: Remove javac support for 6/1.6 source and target values Reviewed-by: jjg, erikj, henryjen
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
30719
91834c070ba5 8074417: Group 13a: golden files for tests in tools/javac/generics dir
sogoel
parents: 5520
diff changeset
     2
 * @test /nodynamiccopyright/
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug 4949303
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary A method returning a raw type cannot override a method returning a generic type
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * @author gafter
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 *
2985
f43e1241e7fb 6843761: Update langtools tests to remove unncessary -source and -target options
darcy
parents: 10
diff changeset
     7
 * @compile  UncheckedCovariance.java
30719
91834c070ba5 8074417: Group 13a: golden files for tests in tools/javac/generics dir
sogoel
parents: 5520
diff changeset
     8
 * @compile/fail/ref=UncheckedCovariance.out -XDrawDiagnostics  -Xlint:unchecked -Werror  UncheckedCovariance.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
class UncheckedCovariance {
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
    static class Box<T> { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
    static class A {
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
        Box<Integer> f() { return null; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
    static class B extends A {
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
        Box f() { return null; }
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
}