Fixup anyvalue handling in call-with-values.

Closes PR 14214.

original commit: 960da4579a66aa0090dbf5ef5db35f052ec5e824
This commit is contained in:
Eric Dobson 2013-12-02 08:55:18 -08:00
parent 8ebfb53cd2
commit 9634b1c8a8
4 changed files with 17 additions and 5 deletions

View File

@ -973,7 +973,11 @@
(-> (-values null))
(->acc (list a) a null)
((list a) (b b) . ->... . (make-ValuesDots (list (-result a)) b 'b))))]
[call-with-values (-polydots (b a) ((-> (make-ValuesDots null a 'a)) (null (a a) . ->... . b) . -> . b))]
[call-with-values
(-polydots (b a)
(cl->*
((-> (make-ValuesDots null a 'a)) (null (a a) . ->... . b) . -> . b)
((-> ManyUniv) ((list) Univ . ->* . b) . -> . b)))]
;; Section 10.2
[raise (cl->* (Univ . -> . (Un))

View File

@ -20,5 +20,7 @@
(export tc-app^)
(link tc-app-main@
tc-app-hetero@ tc-app-list@ tc-app-apply@ tc-app-values@ tc-app-keywords@
tc-app-hetero@ tc-app-list@ tc-app-apply@
(() tc-app-values@)
tc-app-keywords@
tc-app-objects@ tc-app-eq@ tc-app-lambda@ tc-app-special@))

View File

@ -10,7 +10,7 @@
(for-template racket/base))
(import tc-expr^)
(import tc-expr^ tc-app^)
(export tc-app-values^)
(define-tc/app-syntax-class (tc/app-values expected)
@ -19,8 +19,9 @@
(pattern (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)]
[(tc-any-results:)
(tc/app-regular this-syntax expected)]))
;; special case for `values' with single argument
;; we just ignore the values, except that it forces arg to return one value
(pattern (values arg)

View File

@ -1915,6 +1915,11 @@
(getter 'bad 0))]
[tc-err (struct-type-make-constructor 'bad)]
[tc-err (struct-type-make-predicate 'bad)]
[tc-e
(call-with-values (lambda () (eval #'(+ 1 2))) (inst list Any))
(-lst Univ)]
)
(test-suite
"tc-literal tests"