From ff958867d5ee70876de287bcbd0db1fc19f9c4c0 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Sun, 17 Nov 2013 10:34:15 -0800 Subject: [PATCH] Correct type of hash-has-key?. Closes PR 14157. --- .../typed-racket-lib/typed-racket/base-env/base-env.rkt | 4 ++-- .../tests/typed-racket/unit-tests/typecheck-tests.rkt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-env.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-env.rkt index 3cc40b5a35..91c525151e 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-env.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-env.rkt @@ -719,8 +719,8 @@ [hash-ref! (-poly (a b) (cl-> [((-HT a b) a b) b] [((-HT a b) a (-> b)) b]))] -[hash-has-key? (-poly (a b) (cl-> [((-HT a b) a) b] - [(-HashTop a) b]))] +[hash-has-key? (-poly (a b) (cl-> [((-HT a b) a) B] + [(-HashTop a) B]))] [hash-update! (-poly (a b) (cl-> [((-HT a b) a (-> b b)) -Void] [((-HT a b) a (-> b b) (-> b)) -Void]))] diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt index f40df966a2..9decd2d146 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt @@ -975,6 +975,7 @@ (-HT -Number -Number)] [tc-e #{(make-immutable-hash) :: (HashTable String Symbol)} (-HT -String -Symbol)] + [tc-e (hash-has-key? (make-hash '((1 . 2))) 1) -Boolean] [tc-err (let: ([fact : (Number -> Number) (lambda: ([n : Number]) (if (zero? n) 1 (* n (fact (- n 1)))))]) (fact 20))]