TypeInference: reimplemented TypeError