langtools/test/tools/javac/generics/7022054/T7022054neg2.java
author mcimadamore
Thu, 03 Mar 2011 17:34:58 +0000
changeset 8628 9e31f1c01bd4
permissions -rw-r--r--
7022054: Invalid compiler error on covariant overriding methods with the same erasure Summary: Rules for method clash use notion of subsignature, which is sometimes too strict and incompatible with JDK 6 Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8628
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
     1
/*
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
     3
 * @bug 7022054
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
     4
 *
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
     5
 * @summary  Invalid compiler error on covariant overriding methods with the same erasure
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=T7022054neg2.out -XDrawDiagnostics T7022054neg2.java
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
     7
 *
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
     8
 */
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
     9
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
    10
class T7022054neg2 {
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
    11
    static class A {
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
    12
        static A m(String s) { return null; }
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
    13
    }
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
    14
    static class B extends A {
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
    15
        static <X extends String> A m(X s) { return null; }
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
    16
    }
9e31f1c01bd4 7022054: Invalid compiler error on covariant overriding methods with the same erasure
mcimadamore
parents:
diff changeset
    17
}