From 9b93ec46d3710d9638948cde47a809f5c00c1e0e Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Wed, 2 Jun 2010 12:46:03 -0400 Subject: [PATCH] Fix free index computation when the body refers to the bound. original commit: e8a591d2915c54fdf5b674d9859b7ebc7b13dd73 --- collects/typed-scheme/rep/type-rep.rkt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/collects/typed-scheme/rep/type-rep.rkt b/collects/typed-scheme/rep/type-rep.rkt index 1b616544..4e9b861a 100644 --- a/collects/typed-scheme/rep/type-rep.rkt +++ b/collects/typed-scheme/rep/type-rep.rkt @@ -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])