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

@ -140,6 +140,10 @@
(contract-syntax-error-test
'->i-stx23
#'(->i ([f (f x) any/c]) (#:x [x any/c]) [res any/c]))
(test/spec-passed
'->i-stx24
'(->i () (values)))
(test/spec-passed
'->i1

View File

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