Fix PR 10813
svn: r18477 original commit: 87f978e59ecb88b19391e2210b6b3cb550e4df25
This commit is contained in:
parent
3edcfaf5f5
commit
79c93700c7
16
collects/tests/typed-scheme/fail/bad-hash-ref.ss
Normal file
16
collects/tests/typed-scheme/fail/bad-hash-ref.ss
Normal file
|
@ -0,0 +1,16 @@
|
|||
#lang typed/scheme
|
||||
|
||||
(: table (HashTable Integer (-> Integer)))
|
||||
(define table
|
||||
(make-immutable-hash null))
|
||||
|
||||
(: lookup (Integer -> Integer))
|
||||
(define (lookup n)
|
||||
|
||||
(: thunk (-> Integer))
|
||||
(define thunk
|
||||
(hash-ref table n (lambda () 0)))
|
||||
|
||||
(thunk))
|
||||
|
||||
(lookup 1)
|
|
@ -3,7 +3,7 @@
|
|||
(module m typed-scheme
|
||||
(define x ({inst make-hash Symbol Number}))
|
||||
(hash-ref! x 'key (lambda () 1))
|
||||
(hash-ref x 'key 7)
|
||||
(hash-ref x 'key (lambda () 7))
|
||||
(provide x))
|
||||
|
||||
(module n scheme
|
||||
|
|
|
@ -409,20 +409,16 @@
|
|||
[hash-map (-poly (a b c) ((-HT a b) (a b . -> . c) . -> . (-lst c)))]
|
||||
[hash-ref (-poly (a b c)
|
||||
(cl-> [((-HT a b) a) b]
|
||||
[((-HT a b) a (-> c)) (Un b c)]
|
||||
[((-HT a b) a c) (Un b c)]))]
|
||||
[((-HT a b) a (-> c)) (Un b c)]))]
|
||||
[hash-ref! (-poly (a b)
|
||||
(cl-> [((-HT a b) a (-> b)) b]
|
||||
[((-HT a b) a b) b]))]
|
||||
(cl-> [((-HT a b) a (-> b)) b]))]
|
||||
[hash-has-key? (-poly (a b) (-> (-HT a b) a B))]
|
||||
[hash-update! (-poly (a b)
|
||||
(cl-> [((-HT a b) a (-> b b)) -Void]
|
||||
[((-HT a b) a (-> b b) (-> b)) -Void]
|
||||
[((-HT a b) a (-> b b) b) -Void]))]
|
||||
[((-HT a b) a (-> b b) (-> b)) -Void]))]
|
||||
[hash-update (-poly (a b)
|
||||
(cl-> [((-HT a b) a (-> b b)) (-HT a b)]
|
||||
[((-HT a b) a (-> b b) (-> b)) (-HT a b)]
|
||||
[((-HT a b) a (-> b b) b) (-HT a b)]))]
|
||||
[((-HT a b) a (-> b b) (-> b)) (-HT a b)]))]
|
||||
[hash-remove (-poly (a b) ((-HT a b) a . -> . (-HT a b)))]
|
||||
[hash-remove! (-poly (a b) ((-HT a b) a . -> . -Void))]
|
||||
[hash-map (-poly (a b c) ((-HT a b) (a b . -> . c) . -> . (-lst c)))]
|
||||
|
|
Loading…
Reference in New Issue
Block a user