Fix free index computation when the body refers to the bound.

original commit: e8a591d2915c54fdf5b674d9859b7ebc7b13dd73
This commit is contained in:
Sam Tobin-Hochstadt 2010-06-02 12:46:03 -04:00
parent 0d7111128c
commit 9b93ec46d3

View File

@ -72,7 +72,7 @@
(hash-remove (free-vars* dty) dbound)
(free-vars* dty))
(if (symbol? dbound)
(hash-set (free-idxs* dty) dbound Covariant)
(combine-frees (list (make-immutable-hasheq (list (cons dbound Covariant))) (free-idxs* dty)))
(free-idxs* dty))]
[#:fold-rhs (*ListDots (type-rec-id dty) dbound)])
@ -171,7 +171,7 @@
(hash-remove (combine-frees (map free-vars* (cons dty rs))) dbound)
(combine-frees (map free-vars* (cons dty rs))))
(if (symbol? dbound)
(hash-set (combine-frees (map free-idxs* (cons dty rs))) dbound Covariant)
(combine-frees (cons (make-immutable-hasheq (list (cons dbound Covariant))) (map free-idxs* (cons dty rs))))
(combine-frees (map free-idxs* (cons dty rs))))]
[#:fold-rhs (*ValuesDots (map type-rec-id rs) (type-rec-id dty) dbound)])
@ -201,7 +201,8 @@
dom))
(match drest
[(cons t (? symbol? bnd))
(list (hash-set (flip-variances (free-idxs* t)) bnd Contravariant))]
(list (make-immutable-hasheq (list (cons bnd Contravariant)))
(flip-variances (free-idxs* t)))]
[(cons t _)
(list (flip-variances (free-idxs* t)))]
[_ null])