1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/defaultMethods/Neg05.java Wed Apr 27 01:34:52 2016 +0800 1.3 @@ -0,0 +1,16 @@ 1.4 +/* @test /nodynamiccopyright/ 1.5 + * @bug 7192246 1.6 + * @summary check that abstract methods are compatible with inherited defaults 1.7 + * @compile/fail/ref=Neg05.out -XDrawDiagnostics Neg05.java 1.8 + */ 1.9 + 1.10 +class Neg05 { 1.11 + interface IA1 { default Number m() { return Neg05.m1(this); } } 1.12 + interface IA2 extends IA1 { default Integer m() { return Neg05.m2(this); } } 1.13 + interface IA3 extends IA2 { Number m(); } //error 1.14 + 1.15 + static class C implements IA3{} 1.16 + 1.17 + static int m1(IA1 a) { return 0; } 1.18 + static int m2(IA2 b) { return 0; } 1.19 +}