Optimizes the error message by avoiding to display the value/expected types if both are from the same type.