What do you mean saying “doesn’t work”? And if Box is member of class A, then you don’t need downcasting to B1/B2/B3, etc. to access this var.
Box
A