Type check that RHS of shift is integral type
Fixes #5094. There was no check that RHS of shift is an integral type. In most targets, this was probably a backend error prior, but theoretically this could be a breaking change.
OK, there is a problem, since the midend usually lowers type-introduced types back to their underlying type, this bug actually allowed shift by values of type introduced by type, e.g. the PortId_t in dpdk/psa.p4. By the spec (8.23. Operations on types introduced by type) this should not be allowed, but that would be far bigger breaking change than I originally thought. This probably needs more discussion on how to resolve it, I'm thinking of explicitly stripping type in the type checker for now to permit this behavior at least temporarily.
EDIT: --> #5100
According to 8.11.2 in the spec, serializable enums may be implicitly converted to their underlying type, so this code probably needs to deal with that case too.
Right, let me check if I can reuse some existing check for implicit casts, we don't want these duplicated all around.
Replaced with #5446.