closes #1539
This commit is contained in:
Robby Findler 2016-12-17 08:06:46 -06:00
parent 7fcba3fcaa
commit 21cf407616
2 changed files with 34 additions and 8 deletions

View File

@ -1006,6 +1006,29 @@
;; this is probably right (but not what we really really want, of course)
'(9 8 7 6 9 8 7 6 5 4 3 2 1 4 3 2 1))
(test/spec-passed/result
'->i58
'((contract (->i ()
([x integer?]
[y (x) (>=/c x)])
[result any/c])
(λ ([x 0] [y 1]) 2)
'pos 'neg))
2)
(test/spec-passed/result
'->i59
'(let ([b '()])
((contract (->i ()
([x (begin (set! b (cons 1 b)) integer?)]
[y (x) (begin (set! b (cons 'nope b)) (>=/c x))])
[result (begin (set! b (cons 2 b)) any/c)])
(λ ([x #f] [y #f]) (set! b (cons 3 b)) 0)
'pos 'neg))
b)
'(3 2 1)
'(3 2 1 2 1))
(test/pos-blame
'->i-arity1

View File

@ -717,14 +717,17 @@ evaluted left-to-right.)
#`(let (#,@(if (and (arg/res-vars an-arg/res) (not (eres? an-arg/res)))
(list #`[#,contract-identifier
(#,arg/res-proj-var
#,@(map (λ (var)
(arg/res-to-indy-var indy-arg-vars
ordered-args
indy-res-vars
ordered-ress
var))
(arg/res-vars an-arg/res)))])
#,(add-unsupplied-check
an-arg/res
wrapper-arg
#`(#,arg/res-proj-var
#,@(map (λ (var)
(arg/res-to-indy-var indy-arg-vars
ordered-args
indy-res-vars
ordered-ress
var))
(arg/res-vars an-arg/res))))])
(list)))
(let ([#,wrapper-arg
#,(add-unsupplied-check