Fix arity mask upper bound calculation in curry

fixes #2332
This commit is contained in:
Alexis King 2018-10-24 12:15:13 -05:00
parent 11c1a2eaf6
commit af554933ef
2 changed files with 17 additions and 1 deletions

View File

@ -68,3 +68,19 @@
(check-pred procedure? ((curry opt-kw+pos) #t))
(check-equal? (curry opt-kw+pos #:a #t #t) (list #t #t))
(check-equal? ((curry opt-kw+pos) #:a #t #t) (list #t #t))
(define zero-or-one
(case-lambda
[() 0]
[(a) 1]))
(check-equal? (((curry zero-or-one))) 0)
(check-equal? ((curry zero-or-one) #t) 1)
(check-equal? (curry zero-or-one #t) 1)
(define (zero-or-one/kw [x #f] #:y y)
(if x 1 0))
(check-equal? ((curry zero-or-one/kw #:y #f)) 0)
(check-equal? ((curry zero-or-one/kw #:y #f) #t) 1)
(check-equal? (curry zero-or-one/kw #:y #f #t) 1)

View File

@ -49,7 +49,7 @@
(cond
[(eqv? mask 0) #f]
[(negative? mask) +inf.0]
[else (integer-length (sub1 mask))]))
[else (sub1 (integer-length mask))]))
; arity-mask? exact-nonnegative-integer? -> arity-mask?
;