jfranck@2020: /* @test /nodynamiccopyright/ jfranck@2020: * @bug 7192246 mcimadamore@1393: * @summary check that ill-formed MI hierarchies do not compile mcimadamore@1415: * @compile/fail/ref=Neg02.out -XDrawDiagnostics Neg02.java mcimadamore@1393: */ mcimadamore@1393: mcimadamore@1393: class Neg02 { mcimadamore@1393: interface A { mcimadamore@1393: default void m() { Neg02.impl(this); } mcimadamore@1393: } mcimadamore@1393: mcimadamore@1393: interface B { mcimadamore@1393: default void m() { Neg02.impl(this); } mcimadamore@1393: } mcimadamore@1393: mcimadamore@1393: static class X implements A, B { } //error mcimadamore@1393: mcimadamore@1393: void test(X x) { mcimadamore@1393: x.m(); mcimadamore@1393: ((A)x).m(); mcimadamore@1393: ((B)x).m(); mcimadamore@1393: } mcimadamore@1393: mcimadamore@1393: static void impl(A a) { } mcimadamore@1393: static void impl(B b) { } mcimadamore@1393: }