c is a class derived from Abool shouldDoX = (cast(X)c) !is null || (cast(Y)c) !is null || (cast(K)c) !is null ... ;
as the number of cast(C) !is null is growing, I'm afraid of this being a inelegant or even poor performance approach. How would you do that?