switch from case: to if, and tests for some interesting ambiguities