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 2f38508e49..0e62c2aa37 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 @@ -713,12 +713,12 @@ [hash-set! (-poly (a b) ((-HT a b) a b . -> . -Void))] [hash-ref (-poly (a b c) (cl-> [((-HT a b) a) b] + [((-HT a b) a (-val #f)) (-opt b)] [((-HT a b) a (-> c)) (Un b c)] [(-HashTop a) Univ] + [(-HashTop a (-val #f)) Univ] [(-HashTop a (-> c)) Univ]))] -[hash-ref! (-poly (a b) - (cl-> [((-HT a b) a b) b] - [((-HT a b) a (-> b)) b]))] +[hash-ref! (-poly (a b) (-> (-HT a b) a (-> b) b))] [hash-has-key? (-HashTop Univ . -> . B)] [hash-update! (-poly (a b) (cl-> [((-HT a b) a (-> 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 ebc14a2227..a3925076b3 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 @@ -1845,6 +1845,12 @@ (define x 3) (if ((negate pos?) x) x -5)) #:ret (ret -NonPosReal (-FS -top -bot))] + + [tc-err + (hash-ref! (ann (make-hash) (HashTable #f (-> #t))) #f (lambda () #t))] + [tc-e + (hash-ref (ann (make-hash) (HashTable #f #t)) #f #f) + -Boolean] ) (test-suite "tc-literal tests"