make (integer-in x x) produce (and/c x exact?)

fix bug in 9f59d57ee
This commit is contained in:
Robby Findler 2015-01-25 15:31:04 -06:00
parent 87a231b792
commit 6551cc00d6
2 changed files with 2 additions and 6 deletions

View File

@ -40,6 +40,7 @@
(test-flat-contract '(integer-in 0 10) 0 11)
(test-flat-contract '(integer-in 0 10) 10 3/2)
(test-flat-contract '(integer-in 0 10) 1 1.0)
(test-flat-contract '(integer-in 1 1) 1 1.0)
(test-flat-contract '(real-in 1 10) 3/2 20)
(test-flat-contract '(string-len/c 3) "ab" "abc")
(test-flat-contract 'natural-number/c 5 -1)

View File

@ -545,12 +545,7 @@
(define/final-prop (integer-in start end)
(check-two-args 'integer-in start end exact-integer? exact-integer?)
(if (= start end)
;; won't fail, but gets us a contract struct
;; something seems safer to always produce
;; from a contract operation
(coerce-contract 'integer-in start)
(and/c start exact?)
(integer-in-ctc start end)))
(define/final-prop (real-in start end)