This is a simplified version of my problem.
I have a class A that is derived by class B. I also have another class X with a
A
B
X