typemodel: Fix enums

There was a static int member supposed to hold the number of possible enums... After using proper enum-entries to hold the number some more "-Wswitch" errors popped up. Added throws for the default-case. Removed an unreachable assert.