Make the filter actually be opened up in the AnyValues case.
This commit is contained in:
parent
8e63b65fa2
commit
385729260f
|
@ -18,7 +18,7 @@
|
||||||
(define (open-Values v os ts)
|
(define (open-Values v os ts)
|
||||||
(match v
|
(match v
|
||||||
[(AnyValues: f)
|
[(AnyValues: f)
|
||||||
(tc-any-results f)]
|
(tc-any-results (open-Filter f os ts))]
|
||||||
[(Values: results)
|
[(Values: results)
|
||||||
(define-values (t-r f-r o-r)
|
(define-values (t-r f-r o-r)
|
||||||
(for/lists (t-r f-r o-r)
|
(for/lists (t-r f-r o-r)
|
||||||
|
@ -33,6 +33,15 @@
|
||||||
(ret t-r f-r o-r dty dbound)]))
|
(ret t-r f-r o-r dty dbound)]))
|
||||||
|
|
||||||
|
|
||||||
|
(define/cond-contract (open-Filter f objs ts)
|
||||||
|
(-> (Filter/c (listof Object?) (listof Type/c) Filter/c))
|
||||||
|
(for/fold ([f f])
|
||||||
|
([(o arg) (in-indexed (in-list objs))]
|
||||||
|
[arg-ty (in-list ts)])
|
||||||
|
(define key (list 0 arg))
|
||||||
|
(subst-filter f key o #t)))
|
||||||
|
|
||||||
|
|
||||||
;; Substitutes the given objects into the type, filters, and object
|
;; Substitutes the given objects into the type, filters, and object
|
||||||
;; of a Result for function application. This matches up to the substitutions
|
;; of a Result for function application. This matches up to the substitutions
|
||||||
;; in the T-App rule from the ICFP paper.
|
;; in the T-App rule from the ICFP paper.
|
||||||
|
|
|
@ -132,5 +132,12 @@
|
||||||
(list (make-Path null #'x)) (list Univ))
|
(list (make-Path null #'x)) (list Univ))
|
||||||
(ret (-opt (-> Univ -Boolean : (-FS (-filter -Symbol #'x) -top)))))
|
(ret (-opt (-> Univ -Boolean : (-FS (-filter -Symbol #'x) -top)))))
|
||||||
|
|
||||||
|
;; Substitute into filter of any values
|
||||||
|
(check-equal?
|
||||||
|
(open-Values (make-AnyValues (-filter -String '(0 0)))
|
||||||
|
(list (make-Path null #'x)) (list Univ))
|
||||||
|
(tc-any-results (-filter -String #'x)))
|
||||||
|
|
||||||
|
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user