Fix variance of hash tables and parameters

This commit is contained in:
Sam Tobin-Hochstadt 2010-08-13 10:43:49 -04:00
parent 3359032ad5
commit 6e489f8464

View File

@ -330,11 +330,14 @@
;; in : Type
;; out : Type
(dt Param ([in Type/c] [out Type/c]) [#:key 'parameter])
(dt Param ([in Type/c] [out Type/c])
[#:key 'parameter]
[#:frees (λ (f) (combine-frees (list (f out) (flip-variances (f in)))))])
;; key : Type
;; value : Type
(dt Hashtable ([key Type/c] [value Type/c]) [#:key 'hash])
(dt Hashtable ([key Type/c] [value Type/c]) [#:key 'hash]
[#:frees (λ (f) (combine-frees (list (make-invariant (f key)) (make-invariant (f value)))))])
;; parent : Type
;; pred : Identifier