forked from: haxe-like enum switch by throwing

