langtools/test/tools/javac/generics/6476118/T6476118c.java
author mcimadamore
Mon, 07 Feb 2011 18:10:13 +0000
changeset 8242 3873b4aaf4a8
parent 7628 e7baeb97d164
child 45413 75202c6b2c35
permissions -rw-r--r--
7007615: java_util/generics/phase2/NameClashTest02 fails since jdk7/pit/b123. Summary: override clash algorithm is not implemented correctly Reviewed-by: jjg

/**
 * @test  /nodynamiccopyright/
 * @bug 6476118
 * @summary compiler bug causes runtime ClassCastException for generics overloading
 * @compile/fail/ref=T6476118c.out -XDrawDiagnostics T6476118c.java
 */

class T6476118c {
    static class A<T> {
        public void foo(T t) { }
    }

    static class B<T extends Number> extends A<T> {
        public void foo(T t) { }
    }

    static class C extends B<Integer> {
        public void foo(Object o) { }
        public void foo(Number o) { }
    }

    static class D extends C {} //check that no spurious diags generated here!
}