fix issue 10783 - ICE and bad diagnostics when using non-existent
symbols in switch and with statements
Merge pull request #2457 from hpohl/10783

fix issue 10783 - ICE and bad diagnostics when using non-existent symbols in switch and with statements