How can a similar functionality be achieved without errors?
class A { void f(K x) {} } void foo(A extends X> a, X x) { a.f(x); // AN
Keeping in mind the PECS rule, and given the way you are using X, you should be specifying as a lower instead of upper bound:
void foo(A super X> a, X x)
This way no compiler errors are produced, and you have the most general signature applicable.