From b6a53b8916b9c7c556030f9b94e41c20c6fcdb9c Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Thu, 9 Apr 2015 22:45:14 -0700 Subject: [PATCH] Cleanup types of fx+ Fix case for two Bytes which should be Index not PosIndex. --- .../typed-racket/base-env/base-env-numeric.rkt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt b/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt index b0f95d9b..aa0773a6 100644 --- a/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt +++ b/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt @@ -118,11 +118,10 @@ (define fx+-type (lambda () (fx-from-cases - (binop -Zero) - (map (lambda (t) (commutative-binop t -Zero t)) - (list -One -PosByte -Byte -PosIndex -Index)) + (-> -Zero -Int -Fixnum : -true-filter : (-arg-path 1)) + (-> -Int -Zero -Fixnum : -true-filter : (-arg-path 0)) (commutative-binop -PosByte -Byte -PosIndex) - (-Byte -Byte . -> . -PosIndex) + (binop -Byte -Index) ;; in other cases, either we stay within fixnum range, or we error (commutative-binop -Pos -Nat -PosFixnum) (-Nat -Nat . -> . -NonNegFixnum)