Fix typechecking of call-with-values. Closes PR11709.

original commit: 0b761781380ba23a6e363798ad39049a8d4e6eb6
This commit is contained in:
Eric Dobson 2011-07-02 23:06:37 -04:00 committed by Vincent St-Amour
parent 1c0f8a6df8
commit f357d4c0ce
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,19 @@
#lang typed/racket
(define stop-value (gensym))
(: an-alist : (All (A B) (Listof (Pair A B)) -> (Rec R (-> (values (-> (values A B)) (-> R))))))
(define (an-alist lst)
(lambda: ()
(if (null? lst) (raise stop-value)
(let ([first (car lst)]
[rest (cdr lst)])
(values
(lambda: () (values (car first) (cdr first)))
(lambda: () (an-alist rest)))))))
(define alist (an-alist (list (cons 1 2) (cons 3 4) (cons 5 6))))
(call-with-values alist values) ; this works
(call-with-values alist (λ (e a) a))

View File

@ -503,7 +503,7 @@
[(#%plain-app call-with-values prod con)
(match (tc/funapp #'prod #'() (single-value #'prod) null #f)
[(tc-results: ts fs os)
(tc/funapp #'con #'prod (single-value #'con) (map ret ts fs os) expected)])]
(tc/funapp #'con #'(prod) (single-value #'con) (map ret ts fs os) expected)])]
;; in eq? cases, call tc/eq
[(#%plain-app eq?:comparator v1 v2)
;; make sure the whole expression is type correct