hash table keys are contravariant, not covariant
svn: r15077 original commit: e14e58c8df07a874c5a9093c9453de92f3ab04f2
This commit is contained in:
parent
b659f1b16a
commit
17a3d0944e
|
@ -724,6 +724,9 @@
|
|||
(andmap null? (map list y)))
|
||||
(-polydots (a) ((list -Number) (a a) . ->... . -Boolean))]
|
||||
[tc-e (ann (error 'foo) (values Number Number)) #:ret (ret (list -Number -Number))]
|
||||
|
||||
[tc-e #{(make-hash) :: (HashTable Number Number)}
|
||||
(make-Hashtable -Number -Number)]
|
||||
#;[tc-err (let: ([fact : (Number -> Number) (lambda: ([n : Number]) (if (zero? n) 1 (* n (fact (- n 1)))))])
|
||||
(fact 20))]
|
||||
|
||||
|
|
|
@ -386,8 +386,8 @@
|
|||
[((Box: e) (Box: e*))
|
||||
(cset-meet (cg e e*) (cg e* e))]
|
||||
[((Hashtable: s1 s2) (Hashtable: t1 t2))
|
||||
;; the key is covariant, the value is invariant
|
||||
(cset-meet* (list (cg s1 t1) (cg t2 s2) (cg s2 t2)))]
|
||||
;; the key is contravariant, the value is invariant
|
||||
(cset-meet* (list (cg t1 s1) (cg t2 s2) (cg s2 t2)))]
|
||||
[((Syntax: s1) (Syntax: s2))
|
||||
(cg s1 s2)]
|
||||
;; parameters are just like one-arg functions
|
||||
|
|
Loading…
Reference in New Issue
Block a user