diff --git a/pkgs/racket-test/tests/racket/contract/arrow-i.rkt b/pkgs/racket-test/tests/racket/contract/arrow-i.rkt index 4df1a04a14..e403b3ff8e 100644 --- a/pkgs/racket-test/tests/racket/contract/arrow-i.rkt +++ b/pkgs/racket-test/tests/racket/contract/arrow-i.rkt @@ -1550,5 +1550,28 @@ 'pos 'neg) 1)) "(and/c number? (>/c 1))") + + (test/spec-passed/result + 'two-underscores + '((contract (->i ([abc any/c] [_ (abc) any/c]) [_ () any/c]) + (λ (abc whatevs) whatevs) + 'pos 'neg) + 441 144) + 144) + + (test/spec-passed/result + 'many-underscores + '(call-with-values + (λ () ((contract (->i ([abc any/c] [_ (abc) any/c]) + (values [_ () any/c] + [_ () any/c] + [_ () any/c] + [_ () any/c])) + (λ (abc whatevs) + (values 1 2 3 4)) + 'pos 'neg) + 55 66)) + list) + '(1 2 3 4)) ) diff --git a/racket/collects/racket/contract/private/arr-i-parse.rkt b/racket/collects/racket/contract/private/arr-i-parse.rkt index ebbd1be11d..d071398e0a 100644 --- a/racket/collects/racket/contract/private/arr-i-parse.rkt +++ b/racket/collects/racket/contract/private/arr-i-parse.rkt @@ -377,7 +377,8 @@ code does the parsing and validation of the syntax. [[_ (id2 ...) ctc] (begin (for-each (λ (x) (check-id stx x)) (syntax->list #'(id2 ...))) - (list (eres #'_ (syntax->list #'(id2 ...)) #'ctc + (list (eres (car (syntax-e range)) + (syntax->list #'(id2 ...)) #'ctc (compute-quoted-src-expression #'ctc) (car (generate-temporaries '(eres))))))] [[id (id2 ...) ctc]