Commit cc3a9504 authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Ben Gamari
Browse files

Fix the in-scope set for extendTvSubstWithClone

We'd forgotten the variables free in the kind.

Ditto extendCvSubstWithClone

(cherry picked from commit 15fc5281)
parent c33aad1e
......@@ -1718,9 +1718,11 @@ extendTvSubst (TCvSubst in_scope tenv cenv) tv ty
extendTvSubstWithClone :: TCvSubst -> TyVar -> TyVar -> TCvSubst
-- Adds a new tv -> tv mapping, /and/ extends the in-scope set
extendTvSubstWithClone (TCvSubst in_scope tenv cenv) tv tv'
= TCvSubst (extendInScopeSet in_scope tv')
= TCvSubst (extendInScopeSetSet in_scope new_in_scope)
(extendVarEnv tenv tv (mkTyVarTy tv'))
new_in_scope = tyCoVarsOfType (tyVarKind tv') `extendVarSet` tv'
extendCvSubst :: TCvSubst -> CoVar -> Coercion -> TCvSubst
extendCvSubst (TCvSubst in_scope tenv cenv) v co
......@@ -1728,9 +1730,11 @@ extendCvSubst (TCvSubst in_scope tenv cenv) v co
extendCvSubstWithClone :: TCvSubst -> CoVar -> CoVar -> TCvSubst
extendCvSubstWithClone (TCvSubst in_scope tenv cenv) cv cv'
= TCvSubst (extendInScopeSet in_scope cv')
= TCvSubst (extendInScopeSetSet in_scope new_in_scope)
(extendVarEnv cenv cv (mkCoVarCo cv'))
new_in_scope = tyCoVarsOfType (varType cv') `extendVarSet` cv'
extendTvSubstAndInScope :: TCvSubst -> TyVar -> Type -> TCvSubst
-- Also extends the in-scope set
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment