Checking private and abstract classes at compile time