langtools/test/tools/javac/OverrideChecks/StaticOverride.java
author mcimadamore
Wed, 26 Oct 2016 15:41:25 +0100
changeset 41856 13a056e8f16e
parent 24797 850ebd4d80a7
permissions -rw-r--r--
8168774: Polymorhic signature method check crashes javac Summary: Check for polysig method assumes arity is greater than zero Reviewed-by: vromero

/*
 * @test    /nodynamiccopyright/
 * @bug     4041948 4022450
 * @summary javac previously allowed static methods to override non-static
 *          methods in some cases.
 * @author  turnidge
 *
 * @compile/fail/ref=StaticOverride.out -XDrawDiagnostics  StaticOverride.java
 */
interface I{
  int f();
}

class C {
    public static int f() {
        return 7;
    }
}

class StaticOverride extends C implements I { }