jfranck@2020: /* @test /nodynamiccopyright/ jfranck@2020: * @bug 7192246 mcimadamore@1393: * @summary check that re-abstraction works properly mcimadamore@1415: * @compile/fail/ref=Neg03.out -XDrawDiagnostics Neg03.java mcimadamore@1393: */ mcimadamore@1393: mcimadamore@1393: class Neg03 { mcimadamore@1393: interface A { mcimadamore@1393: default void m() { Neg03.one(this); } mcimadamore@1393: } mcimadamore@1393: mcimadamore@1393: interface B { mcimadamore@1393: default void m() { Neg03.two(this); } mcimadamore@1393: } mcimadamore@1393: mcimadamore@1393: interface C extends A, B { mcimadamore@1393: default void m() { Neg03.one(this); } mcimadamore@1393: } mcimadamore@1393: mcimadamore@1393: static class X implements C, A { } //ok - ignore extraneous remix of A mcimadamore@1393: mcimadamore@1393: interface D extends A, B { mcimadamore@1393: void m(); // ok - m() is not reabstracted! mcimadamore@1393: } mcimadamore@1393: mcimadamore@1393: static class Y implements D, A { } // invalid - abstract D.m() mcimadamore@1393: mcimadamore@1393: interface E extends A { mcimadamore@1393: void m(); // reabstraction of m() mcimadamore@1393: } mcimadamore@1393: mcimadamore@1393: static class W implements D, E { } // invalid - abstracts D.m()/E.m() mcimadamore@1393: mcimadamore@1393: static class Z implements D, A, B { } // invalid - abstract D.m() mcimadamore@1393: mcimadamore@1393: static void one(Object a) { } mcimadamore@1393: static void two(Object a) { } mcimadamore@1393: }