Support an empty (values) range in ->i

This commit is contained in:
Brian Lachance 2016-08-23 11:35:45 -04:00 committed by Robby Findler
parent 471f37158a
commit 07718022b4
2 changed files with 6 additions and 1 deletions

View File

@ -141,6 +141,10 @@
'->i-stx23 '->i-stx23
#'(->i ([f (f x) any/c]) (#:x [x any/c]) [res any/c])) #'(->i ([f (f x) any/c]) (#:x [x any/c]) [res any/c]))
(test/spec-passed
'->i-stx24
'(->i () (values)))
(test/spec-passed (test/spec-passed
'->i1 '->i1
'((contract (->i () () [x number?]) (lambda () 1) 'pos 'neg))) '((contract (->i () () [x number?]) (lambda () 1) 'pos 'neg)))

View File

@ -824,7 +824,8 @@ evaluted left-to-right.)
indy-arg-vars ordered-args indy-res-vars ordered-ress indy-arg-vars ordered-args indy-res-vars ordered-ress
stx) stx)
(cond (cond
[(and (istx-ress an-istx) [(and (positive? (vector-length res-proj-vars))
(istx-ress an-istx)
(andmap eres? (istx-ress an-istx))) (andmap eres? (istx-ress an-istx)))
(for/fold ([body stx]) (for/fold ([body stx])
([an-arg/res (in-list (reverse (istx-ress an-istx)))] ([an-arg/res (in-list (reverse (istx-ress an-istx)))]