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

@ -1007,6 +1007,29 @@
;; this is probably right (but not what we really really want, of course) ;; 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)) '(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 (test/pos-blame
'->i-arity1 '->i-arity1
'(contract (->i ([x number?]) () any) (λ () 1) 'pos 'neg)) '(contract (->i ([x number?]) () any) (λ () 1) 'pos 'neg))

View File

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