diff --git a/pkgs/racket-test/tests/racket/contract/arrow-i.rkt b/pkgs/racket-test/tests/racket/contract/arrow-i.rkt index 3b7646e66f..4df1a04a14 100644 --- a/pkgs/racket-test/tests/racket/contract/arrow-i.rkt +++ b/pkgs/racket-test/tests/racket/contract/arrow-i.rkt @@ -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 diff --git a/racket/collects/racket/contract/private/arr-i.rkt b/racket/collects/racket/contract/private/arr-i.rkt index e4dd1363b9..d481ad28ea 100644 --- a/racket/collects/racket/contract/private/arr-i.rkt +++ b/racket/collects/racket/contract/private/arr-i.rkt @@ -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