Is this actually used?  Looks like a copy of `_check_type`