Fix construction of predicate type for `declare-refinement'.

svn: r14933

original commit: 7237ad6046a636b4ce0f5f1354fc0ff9237e416c
This commit is contained in:
Sam Tobin-Hochstadt 2009-05-22 19:26:06 +00:00
parent e48efb7618
commit 44e0580370

View File

@ -44,11 +44,11 @@
;; FIXME - this sucks and should die
[(define-values () (begin (quote-syntax (declare-refinement-internal pred)) (#%plain-app values)))
(match (lookup-type/lexical #'pred)
[(and t (Function: (list (arr: (list dom) rng #f #f '()))))
(register-type #'pred
(make-pred-ty (list dom)
rng
(make-Refinement dom #'pred (syntax-local-certifier))))
[(and t (Function: (list (arr: (list dom) (Values: (list (Result: rng _ _))) #f #f '()))))
(let ([new-t (make-pred-ty (list dom)
rng
(make-Refinement dom #'pred (syntax-local-certifier)))])
(register-type #'pred new-t))
(list)]
[t (tc-error "cannot declare refinement for non-predicate ~a" t)])]