SI-6955 switch emission no longer foiled by type alias

dealiasWiden the type of the scrutinee before checking it's switchable
now with tests! (using IcodeTest since javap is not available everywhere)

rebase of #1879
Merge pull request #1881 from adriaanm/rebase-1879-master

SI-6955 switch emission no longer foiled by type alias