1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/defaultMethods/Neg02.java Wed Apr 27 01:34:52 2016 +0800 1.3 @@ -0,0 +1,26 @@ 1.4 +/* @test /nodynamiccopyright/ 1.5 + * @bug 7192246 1.6 + * @summary check that ill-formed MI hierarchies do not compile 1.7 + * @compile/fail/ref=Neg02.out -XDrawDiagnostics Neg02.java 1.8 + */ 1.9 + 1.10 +class Neg02 { 1.11 + interface A { 1.12 + default void m() { Neg02.impl(this); } 1.13 + } 1.14 + 1.15 + interface B { 1.16 + default void m() { Neg02.impl(this); } 1.17 + } 1.18 + 1.19 + static class X implements A, B { } //error 1.20 + 1.21 + void test(X x) { 1.22 + x.m(); 1.23 + ((A)x).m(); 1.24 + ((B)x).m(); 1.25 + } 1.26 + 1.27 + static void impl(A a) { } 1.28 + static void impl(B b) { } 1.29 +}