1/* 2 * @test /nodynamiccopyright/ 3 * @bug 4725668 4 * @summary generics: reject implementation with incorrect return type 5 * @author gafter 6 * 7 * @compile/fail/ref=SelfImplement.out -XDrawDiagnostics SelfImplement.java 8 */ 9 10class SelfImplement { 11 static abstract class A<T> { 12 abstract void f(T t); 13 public int f(Integer t) { return 3; } 14 } 15 static abstract class B extends A<Integer> { 16 // error: A<Integer>.f(Integer) returning int can't implement 17 // A<Integer>.f(Integer) returning void. 18 } 19} 20