From bee2da86df41cc0cfe8b1d28b241cfba6aa12ecb Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Tue, 4 Feb 2014 16:18:06 -0500 Subject: [PATCH] Fix printing of rest argument types in TR This was a regression that snuck in with pretty printing original commit: 739f236da363c5f63c72e892aa841f012d567cd9 --- .../typed-racket-lib/typed-racket/types/printer.rkt | 2 +- .../tests/typed-racket/unit-tests/type-printer-tests.rkt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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 d8f2ad8c..ab2d4f47 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 @@ -222,7 +222,7 @@ (format "~a ~a" k (type->sexp t)) (format "[~a ~a]" k (type->sexp t)))])) (if rest - (list rest (if (special-dots-printing?) '...* '*)) + (list (type->sexp rest) (if (special-dots-printing?) '...* '*)) null) (if drest (if (special-dots-printing?) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/type-printer-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/type-printer-tests.rkt index 60b0d831..f8754009 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/type-printer-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/type-printer-tests.rkt @@ -71,6 +71,9 @@ (check-prints-as? (-> -Input-Port (make-Values (list (-result -String (-FS -top -bot) -no-obj) (-result -String (-FS -top -bot) -no-obj)))) "(Input-Port -> (values (String : (Top | Bot)) (String : (Top | Bot))))") + ;; this case tests that the Number union is printed with its name + ;; rather than its expansion (a former bug) + (check-prints-as? (->* '() -Number -Void) "(Number * -> Void)") (check-prints-as? (->key Univ -Pathlike #:exists (one-of/c 'error 'append 'update 'replace