Fri, 24 Apr 2020 03:58:51 +0100
Merge
1 /* @test /nodynamiccopyright/
2 * @bug 7192246
3 * @summary check that re-abstraction works properly
4 * @compile/fail/ref=Neg03.out -XDrawDiagnostics Neg03.java
5 */
7 class Neg03 {
8 interface A {
9 default void m() { Neg03.one(this); }
10 }
12 interface B {
13 default void m() { Neg03.two(this); }
14 }
16 interface C extends A, B {
17 default void m() { Neg03.one(this); }
18 }
20 static class X implements C, A { } //ok - ignore extraneous remix of A
22 interface D extends A, B {
23 void m(); // ok - m() is not reabstracted!
24 }
26 static class Y implements D, A { } // invalid - abstract D.m()
28 interface E extends A {
29 void m(); // reabstraction of m()
30 }
32 static class W implements D, E { } // invalid - abstracts D.m()/E.m()
34 static class Z implements D, A, B { } // invalid - abstract D.m()
36 static void one(Object a) { }
37 static void two(Object a) { }
38 }