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 ab77623d..f4e92163 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 @@ -244,9 +244,13 @@ [(Values: (list (Result: t (FilterSet: (Top:) (Top:)) (Empty:)))) (list (type->sexp t))] [(Values: (list (Result: t - (FilterSet: (TypeFilter: ft pth id) - (NotTypeFilter: ft pth id)) + (FilterSet: (TypeFilter: ft pth (list 0 0)) + (NotTypeFilter: ft pth (list 0 0))) (Empty:)))) + ;; Only print a simple filter for single argument functions, + ;; since parse-type only accepts simple latent filters on single + ;; argument functions. + #:when (= 1 (length dom)) (if (null? pth) `(,(type->sexp t) : ,(type->sexp ft)) `(,(type->sexp t) : ,(type->sexp ft) @ 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 a41b2781..09f2f726 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 @@ -75,6 +75,16 @@ "(-> Any Boolean : String)") (check-prints-as? (asym-pred Univ -Boolean (-FS (-filter -String 0) -top)) "(-> Any Boolean : #:+ String)") + ;; PR 14510 (next three tests) + (check-prints-as? (-> Univ (-> Univ -Boolean : (-FS (-filter -String '(1 0)) + (-not-filter -String '(1 0))))) + "(-> Any (-> Any Boolean))") + (check-prints-as? (-> Univ Univ -Boolean : (-FS (-filter -String '(0 1)) + (-not-filter -String '(0 1)))) + "(-> Any Any Boolean)") + (check-prints-as? (-> Univ Univ -Boolean : (-FS (-filter -String '(0 0)) + (-not-filter -String '(0 0)))) + "(-> Any Any Boolean)") (check-prints-as? (-> Univ (make-Values (list (-result -String -top-filter -empty-obj) (-result -String -top-filter -empty-obj)))) "(-> Any (values String String))")