From 830db3c908f6b1b212036d1763a18ffeba884391 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Thu, 7 Feb 2013 15:09:58 -0500 Subject: [PATCH] Add extra tests and warning about -PosIntNotFixnum. --- collects/tests/typed-racket/unit-tests/typecheck-tests.rkt | 2 ++ collects/typed-racket/types/numeric-tower.rkt | 3 +++ 2 files changed, 5 insertions(+) diff --git a/collects/tests/typed-racket/unit-tests/typecheck-tests.rkt b/collects/tests/typed-racket/unit-tests/typecheck-tests.rkt index 2baacdd12d..bbd8ba6245 100644 --- a/collects/tests/typed-racket/unit-tests/typecheck-tests.rkt +++ b/collects/tests/typed-racket/unit-tests/typecheck-tests.rkt @@ -171,6 +171,8 @@ (tc-e (- 1) -NegFixnum) (tc-e (- 1073741823) -NegFixnum) (tc-e (- -4) -PosFixnum) + (tc-e/t 1152921504606846975 -PosInt) + (tc-e/t -1152921504606846975 -NegInt) (tc-e (- 3253463567262345623) -NegInt) (tc-e (- -23524623547234734568) -PosInt) (tc-e (- 241.3) -NegFlonum) diff --git a/collects/typed-racket/types/numeric-tower.rkt b/collects/typed-racket/types/numeric-tower.rkt index 31234fc5ef..1a8404b693 100644 --- a/collects/typed-racket/types/numeric-tower.rkt +++ b/collects/typed-racket/types/numeric-tower.rkt @@ -103,6 +103,9 @@ #'-NegFixnum)) (define -NonPosFixnum (*Un -NegFixnum -Zero)) (define -Fixnum (*Un -NegFixnum -Zero -PosFixnum)) +;; This type, and others like it, should *not* be exported, or used for +;; anything but building unions. Especially, no literals should be given +;; these types. (define -PosIntNotFixnum (make-Base 'Positive-Integer-Not-Fixnum #'(and/c exact-integer? positive? (not/c fixnum?))