Make combine-results work with tc-result/c.
original commit: 7acc9eaf0a3111101fd2781bc6c760be4c0a1eef
This commit is contained in:
parent
9d60283c46
commit
b05b207667
|
@ -93,10 +93,10 @@
|
|||
(combine-results
|
||||
(for/list ([stx (in-list stxs)] [ty (in-list tys)]
|
||||
[a (in-list anns)] [f (in-list fs)] [o (in-list os)])
|
||||
(cond [a (check-type stx ty a) (ret a f o)]
|
||||
(cond [a (check-type stx ty a) (tc-result a f o)]
|
||||
;; mutated variables get generalized, so that we don't infer too small a type
|
||||
[(is-var-mutated? stx) (ret (generalize ty) f o)]
|
||||
[else (ret ty f o)]))))]))))]))
|
||||
[(is-var-mutated? stx) (tc-result (generalize ty) f o)]
|
||||
[else (tc-result ty f o)]))))]))))]))
|
||||
|
||||
;; check that e-type is compatible with ty in context of stx
|
||||
;; otherwise, error
|
||||
|
|
|
@ -94,9 +94,9 @@
|
|||
(define (-tc-result type filter object)
|
||||
(cond
|
||||
[(or (equal? type -Bottom) (equal? filter -bot-filter))
|
||||
(make-tc-result -Bottom -bot-filter object)]
|
||||
(tc-result -Bottom -bot-filter object)]
|
||||
[else
|
||||
(make-tc-result type filter object)]))
|
||||
(tc-result type filter object)]))
|
||||
|
||||
|
||||
;; convenience function for returning the result of typechecking an expression
|
||||
|
@ -148,7 +148,7 @@
|
|||
|
||||
(define (combine-results tcs)
|
||||
(match tcs
|
||||
[(list (tc-result1: t f o) ...)
|
||||
[(list (tc-result: t f o) ...)
|
||||
(ret t f o)]))
|
||||
|
||||
(define tc-result-equal? equal?)
|
||||
|
@ -156,8 +156,8 @@
|
|||
(provide tc-result: tc-results: tc-any-results: tc-result1: Result1: Results:
|
||||
tc-results)
|
||||
(provide/cond-contract
|
||||
[tc-result (Type/c FilterSet/c Object? . c:-> . tc-result?)]
|
||||
[combine-results ((c:listof tc-results?) . c:-> . tc-results?)]
|
||||
[rename -tc-result tc-result (Type/c FilterSet/c Object? . c:-> . tc-result?)]
|
||||
[combine-results ((c:listof tc-result?) . c:-> . tc-results?)]
|
||||
[tc-any-results ((c:or/c Filter/c NoFilter?) . c:-> . tc-any-results?)]
|
||||
[tc-result-t (tc-result? . c:-> . Type/c)]
|
||||
[rename tc-results-ts* tc-results-ts (tc-results? . c:-> . (c:listof Type/c))]
|
||||
|
|
Loading…
Reference in New Issue
Block a user