changing the definition of type_cast to expose the equivalence.