public class A> { private void m() { } private int pi; private void f(X x) { ((A)x).m(); // OK int i = ((A)x).pi; // OK } }