diff --git a/pkgs/racket-test/tests/racket/contract/flat-contracts.rkt b/pkgs/racket-test/tests/racket/contract/flat-contracts.rkt index dcab995e13..73ce62b6b6 100644 --- a/pkgs/racket-test/tests/racket/contract/flat-contracts.rkt +++ b/pkgs/racket-test/tests/racket/contract/flat-contracts.rkt @@ -58,6 +58,7 @@ (test-flat-contract '(and/c exact-integer? (between/c -10 10)) -1 -11) (test-flat-contract '(and/c exact-integer? (between/c -10.5 10.5)) -10 -11) (test-flat-contract '(and/c exact-integer? (between/c -10.5 10.5)) 10 11) + (test-flat-contract '(and/c exact-integer? (<=/c 0)) -1 -3/2) (test-flat-contract '(char-in #\a #\z) #\a #\Z) (test-flat-contract '(char-in #\a #\z) #\z #\A) (test-flat-contract '(char-in #\a #\z) #\b "b") diff --git a/racket/collects/racket/contract/private/and.rkt b/racket/collects/racket/contract/private/and.rkt index bd760e56a9..d1ec549e8d 100644 --- a/racket/collects/racket/contract/private/and.rkt +++ b/racket/collects/racket/contract/private/and.rkt @@ -234,7 +234,7 @@ [(between/c-s? other) (define other-low (between/c-s-low other)) (define other-high (between/c-s-high other)) - (integer-in (exact-ceiling (if (= other-low -inf.0) #f other-low)) + (integer-in (if (= other-low -inf.0) #f (exact-ceiling other-low)) (if (= other-high +inf.0) #f (exact-floor other-high)))] [else (make-first-order-and/c contracts preds)])] [else @@ -249,6 +249,7 @@ (define (exact-ceiling x) (ceiling (inexact->exact x))) (struct integer-in-ctc (start end) + #:property prop:custom-write custom-write-property-proc #:property prop:flat-contract (build-flat-contract-property #:name (λ (ctc)