class X { void method(String t) { } } class Y extends X { void method(S s) { } } class Test { void x(final Y err) { err.method(""); } }