Remove broken and basically unused fastCast code for types
Only a few places in the ::equals implementations used this code. But it was not generic and actually unsafe to use elsewhere, note how e.g. the implementation for TypeAlias used the wrong WhichType. The implementation for ConstantIntegralType wasn't actually fast, it still always required an dynamic_cast. And in general, all other implementations where possibly broken for subclasses: When such a subclass would return a different WhichType, we would have always failed. Handling that would need a fallback to dynamic_cast, in which case we don't really gain anything code-generation wise. I doubt the speed impact is required - esp. considering this isn't used in practice anywhere so far... Just replace the few usages in assertions with dynamic_cast and get rid of fastCast code.
parent
428eb19c
Please register or sign in to comment