From 49cd879bf89dc924520dfa2a86de3a7513490a2a Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Tue, 19 Nov 2013 14:28:27 -0500 Subject: [PATCH] Only recommend expanding union types. Closes PR14166. --- .../typed-racket-lib/typed-racket/types/printer.rkt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 510344cbe6..1158d4e73b 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 @@ -148,9 +148,8 @@ (cond [(null? to-cover) ; done (define coverage-names (map car coverage)) ;; to allow :type to cue the user on unexpanded aliases + ;; only union types can flow here, and any of those could be expanded (set-box! (current-print-unexpanded) - ;; FIXME: this could be pickier about the names to - ;; report since, e.g., "String" can't be expanded (append coverage-names (unbox (current-print-unexpanded)))) (append coverage-names uncoverable)] ; we want the names [else @@ -270,8 +269,9 @@ (print-type type port write? (append names ignored-names)))] [else ;; to allow :type to cue the user on unexpanded aliases - (set-box! (current-print-unexpanded) - (cons (car names) (unbox (current-print-unexpanded)))) + (when (Union? type) ; only unions can be expanded + (set-box! (current-print-unexpanded) + (cons (car names) (unbox (current-print-unexpanded))))) (fp "~a" (car names))])] [(StructType: (Struct: nm _ _ _ _ _)) (fp "(StructType ~a)" (syntax-e nm))] [(StructTop: (Struct: nm _ _ _ _ _)) (fp "(Struct ~a)" (syntax-e nm))]