fix case-> to not abuse procedure-chaperone
closes PR 13697
This commit is contained in:
parent
d1e7841f84
commit
a46e4c71b6
|
@ -1561,7 +1561,12 @@ v4 todo:
|
||||||
(this-parameter ... dom-formals ... . #,(if rst #'rst-formal '()))
|
(this-parameter ... dom-formals ... . #,(if rst #'rst-formal '()))
|
||||||
#,(cond
|
#,(cond
|
||||||
[rng
|
[rng
|
||||||
(let ([rng-checkers (list #'(λ (rng-id ...) (values/drop (rng-proj-x rng-id) ...)))]
|
(let ([rng-checkers (list #`(case-lambda
|
||||||
|
[(rng-id ...) (values/drop (rng-proj-x rng-id) ...)]
|
||||||
|
[args
|
||||||
|
(bad-number-of-results blame f
|
||||||
|
#,(length (syntax->list #'(rng-id ...)))
|
||||||
|
args)]))]
|
||||||
[rng-length (length (syntax->list rng))])
|
[rng-length (length (syntax->list rng))])
|
||||||
(if rst
|
(if rst
|
||||||
(check-tail-contract #'(rng-proj-x ...) rng-checkers
|
(check-tail-contract #'(rng-proj-x ...) rng-checkers
|
||||||
|
|
|
@ -3578,6 +3578,16 @@
|
||||||
(f 'x (open-input-string (format "~s" "string")))))
|
(f 'x (open-input-string (format "~s" "string")))))
|
||||||
(list #\a #f "xstring"))
|
(list #\a #f "xstring"))
|
||||||
|
|
||||||
|
(test/pos-blame
|
||||||
|
'contract-case->15
|
||||||
|
'((contract (case-> (-> real? real? real?)
|
||||||
|
(-> real? (values real? real?)))
|
||||||
|
(case-lambda
|
||||||
|
[(x y) 1]
|
||||||
|
[(x) 1])
|
||||||
|
'pos 'neg)
|
||||||
|
1))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; case-> arity checking tests ;;
|
;; case-> arity checking tests ;;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user