diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/printer.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/printer.rkt index 84dd266598..1de6cd9dad 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/printer.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/printer.rkt @@ -58,16 +58,12 @@ ;; does t have a type name associated with it currently? ;; has-name : Type -> Maybe[Listof] (define (has-name? t) - (cond - [print-aliases - (define candidates - (for/list ([(n t*) (in-pairs (in-list (force (current-type-names))))] - #:when (and (Type? t*) (type-equal? t t*))) - n)) - (if (null? candidates) - #f - (sort candidates string>? #:key symbol->string))] - [else #f])) + (define candidates + (for/list ([(n t*) (in-pairs (in-list (force (current-type-names))))] + #:when (and print-aliases (Type? t*) (type-equal? t t*))) + n)) + (and (pair? candidates) + (sort candidates string>? #:key symbol->string #:cache-keys? #t))) ;; print- : Output-Port Boolean -> Void ;; print-type also takes an optional (Listof Symbol)