[cs] don't generate redundant switch in __hx_cast functions