From 265603ed694375d3b355b976e5ec05fbe10a03e5 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Sat, 20 Jul 2013 17:18:27 -0700 Subject: [PATCH] Make Bottom generalize to Any instead of Integer. --- .../racket/benchmarks/shootout/typed/reversecomplement.rktl | 1 + .../typed-racket-lib/typed-racket/types/generalize.rkt | 1 + .../tests/typed-racket/unit-tests/typecheck-tests.rkt | 1 + 3 files changed, 3 insertions(+) diff --git a/pkgs/racket-pkgs/racket-test/tests/racket/benchmarks/shootout/typed/reversecomplement.rktl b/pkgs/racket-pkgs/racket-test/tests/racket/benchmarks/shootout/typed/reversecomplement.rktl index caf99799d4..cb0ac95596 100644 --- a/pkgs/racket-pkgs/racket-test/tests/racket/benchmarks/shootout/typed/reversecomplement.rktl +++ b/pkgs/racket-pkgs/racket-test/tests/racket/benchmarks/shootout/typed/reversecomplement.rktl @@ -1,6 +1,7 @@ ;; The Computer Language Benchmarks Game ;; http://shootout.alioth.debian.org/ +(: translation (Vectorof Integer)) (define translation (make-vector 128)) (for: ([from : Char (in-string "ACGTUMRWSYKVHDBN")] diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/generalize.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/generalize.rkt index 9956769f38..cba2f6eedc 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/generalize.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/generalize.rkt @@ -20,6 +20,7 @@ [(Value: '()) (-lst Univ)] [(Value: 0) -Int] [(List: ts) (-lst (apply Un ts))] + [(? (lambda (t) (subtype t -Bottom))) Univ] [(? (lambda (t) (subtype t -Int))) -Int] [(? (lambda (t) (subtype t -Rat))) -Rat] [(? (lambda (t) (subtype t -Flonum))) -Flonum] diff --git a/pkgs/typed-racket-pkgs/typed-racket-tests/tests/typed-racket/unit-tests/typecheck-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-tests/tests/typed-racket/unit-tests/typecheck-tests.rkt index 714ec5745d..5a584a93e6 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-tests/tests/typed-racket/unit-tests/typecheck-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-tests/tests/typed-racket/unit-tests/typecheck-tests.rkt @@ -1692,6 +1692,7 @@ (tc-l #"foo" -Bytes) [tc-l () (-val null)] [tc-l (3 . 4) (-pair -PosByte -PosByte)] + [tc-l #hash() (make-Hashtable Univ Univ)] [tc-l #hash((1 . 2) (3 . 4)) (make-Hashtable -Integer -Integer)] [tc-l #hasheq((a . q) (b . w)) (make-Hashtable -Symbol -Symbol)]) [tc-l #hash{[:a . :b]}