langtools/test/tools/javac/defaultMethods/Neg01.java
author jlahoda
Wed, 09 Oct 2013 13:06:49 +0200
changeset 21005 4db633bd7696
parent 19934 1d8232b1aa18
permissions -rw-r--r--
8025141: java.lang.ClassFormatError: Illegal field modifiers in class (...) Summary: Should not generate non-public $assertionsDisabled field into interfaces Reviewed-by: jjg, vromero

/* @test /nodynamiccopyright/
 * @bug 7192246
 * @summary negative test for ambiguous defaults
 * @compile/fail/ref=Neg01.out -XDrawDiagnostics Neg01.java
 */

class Neg01 {
    interface IA { default int m() { return Neg01.m1(this); } }
    interface IB { default int m() { return Neg01.m2(this); } }

    static class A implements IA {}
    static class B implements IB {}

    static class AB implements IA, IB {}

    static int m1(IA a) { return 0; }
    static int m2(IB b) { return 0; }
}