SI-6956 determine switchability by type, not tree

Constant folding will set the type of a constant tree
to `ConstantType(Constant(folded))`, while the tree
itself can be many different things (in casu, an Ident).

We used to look at the tree directly when deciding whether
to emit a switch. Now we look at the tree's type. Voilà.
use Constant::isIntRange even if it's NIH
Merge pull request #1905 from adriaanm/ticket-6956

SI-6956 determine switchability by type, not tree