fix constant value check in switch statement generation