Fix: Collect variables declare in switch-case.(fixes #1453)