Fix printing of AnyValues with filters.

original commit: 817ec2238a96319985293f3743cc5cdb781c6ede
This commit is contained in:
Eric Dobson 2014-05-26 12:01:33 -07:00
parent cece2ccc77
commit f97ef41153
2 changed files with 9 additions and 2 deletions

View File

@ -240,7 +240,7 @@
null)
(match rng
[(AnyValues: (Top:)) '(AnyValues)]
[(AnyValues: f) `(AnyValues : ,(type->sexp f))]
[(AnyValues: f) `(AnyValues : ,(filter->sexp f))]
[(Values: (list (Result: t (FilterSet: (Top:) (Top:)) (Empty:))))
(list (type->sexp t))]
[(Values: (list (Result: t
@ -480,7 +480,7 @@
[(F: nm) nm]
;; FIXME (Values are not types and shouldn't need to be considered here
[(AnyValues: (Top:)) 'AnyValues]
[(AnyValues: f) (displayln (list 'this-case (NoFilter? f) (Top? f))) `(AnyValues : ,(filter->sexp f))]
[(AnyValues: f) `(AnyValues : ,(filter->sexp f))]
[(Values: (list v)) v]
[(Values: (list v ...)) (cons 'values (map t->s v))]
[(ValuesDots: v dty dbound)

View File

@ -104,6 +104,13 @@
" 'append 'update 'replace 'truncate"
" 'truncate/replace)] [#:mode (U"
" 'binary 'text)] Void)"))
(check-prints-as? (-> Univ (-AnyValues -top)) "(-> Any AnyValues)")
(check-prints-as? (-> Univ (-AnyValues (-filter -String '(0 0))))
"(-> Any AnyValues : (String @ (0 0)))")
(check-prints-as? (-AnyValues -top) "AnyValues")
(check-prints-as? (-AnyValues (-filter -String '(0 0)))
"(AnyValues : (String @ (0 0)))")
(check-prints-as? (->opt Univ [] -Void) "(-> Any Void)")
(check-prints-as? (->opt [-String] -Void) "(->* () (String) Void)")
(check-prints-as? (->opt Univ [-String] -Void) "(->* (Any) (String) Void)")