@type_check for 'compare'