diff --git a/typed-racket-lib/typed-racket/base-env/base-env-indexing-abs.rkt b/typed-racket-lib/typed-racket/base-env/base-env-indexing-abs.rkt index 12fc07eb..da29cd09 100644 --- a/typed-racket-lib/typed-racket/base-env/base-env-indexing-abs.rkt +++ b/typed-racket-lib/typed-racket/base-env/base-env-indexing-abs.rkt @@ -311,11 +311,8 @@ [integer->integer-bytes (-Integer index-type Univ [Univ -Bytes index-type] . ->opt . -Bytes)] [integer-bytes->integer (cl->* - ;; Any truthy value (not only #t) would work here. - ;; We can define a truthy type (without difference types (- Univ #f)) - ;; by unioning everything (including StructTop and co). - ;; We should do this at some point. - (-Bytes (-val #t) [Univ index-type index-type] . ->opt . -Nat) + ;; Second argument is `signed?` --- if `#false` the result is a `-Nat` + (-Bytes (-val #f) [Univ index-type index-type] . ->opt . -Nat) (-Bytes Univ [Univ index-type index-type] . ->opt . -Integer))] [peek-char diff --git a/typed-racket-test/unit-tests/typecheck-tests.rkt b/typed-racket-test/unit-tests/typecheck-tests.rkt index 7991da67..182f6f0e 100644 --- a/typed-racket-test/unit-tests/typecheck-tests.rkt +++ b/typed-racket-test/unit-tests/typecheck-tests.rkt @@ -664,8 +664,8 @@ (when (boolean? x) #t)) -Void] - [tc-e (integer-bytes->integer '#"abcd" #t) -Nat] - [tc-e (integer-bytes->integer '#"abcd" #f) -Int] + [tc-e (integer-bytes->integer '#"abcd" #t) -Int] + [tc-e (integer-bytes->integer '#"abcd" #f) -Nat] [tc-e/t (let: ([x : Any 3]) (if (list? x)