ref #6526 extract comparator and add another for TypeDesignationBase