For now this is needed in two places:
- Switch type, equality testing can be made easier and better
- Mapper type, since the key in the mappings array is always string, we need to statically determine the type of the inner field, so that we can convert it to the appropriate type
Note that there are hacks to get around both of these. I would rather do it the proper way.
This could also used for compile time type checking, we could for example verify that the field referred to in a array count is an integer.