[IR2Vec][NFC] Map TypeIDs to canonical types with a switch (#246069)
TypeIDMapping was indexed by Type::TypeID and relied on listing the
types in enum order; its static_assert only checked the size. A TypeID
inserted in the middle of the enum would silently shift the mapping. Use
an exhaustive switch instead so that new TypeIDs are flagged.