implement #482, literal cases, and improve error spans/messages for
switch-related problems