Fix "if" codegen when the type is union but one of the branches has no type