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

http://d.puremagic.com/issues/show_bug.cgi?id=10783