Issue 4540 - Better diagnostic for wrong switch type.

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