Add #f as a special case for hash-ref, fix hash-ref!.

Closes PR 14158.

Merge to 6.0.

original commit: 258d9b8e2f53936ff166c069ca0ab267ed77f602
This commit is contained in:
Eric Dobson 2013-12-01 11:25:52 -08:00
parent 459a59a954
commit 2791f89cd2
2 changed files with 9 additions and 3 deletions

View File

@ -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]

View File

@ -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"