summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2016-01-25 22:00:47 -0500
committerRichard Eisenberg <eir@cis.upenn.edu>2016-01-27 09:28:29 -0500
commit2899aa580d633103fc551e36c977720b94f5b41c (patch)
treeddb70b0b5cd37e8842c0c1f79105c6cba2869836
parent4faa1a63d0496fd511d2d139622dbf7ef2ce4655 (diff)
downloadhaskell-2899aa580d633103fc551e36c977720b94f5b41c.tar.gz
Fix some substitution InScopeSets
This is relevant to #11371.
-rw-r--r--compiler/typecheck/TcHsType.hs2
-rw-r--r--compiler/typecheck/TcMType.hs2
-rw-r--r--compiler/typecheck/TcType.hs1
-rw-r--r--compiler/types/TyCoRep.hs4
-rw-r--r--compiler/types/Type.hs4
5 files changed, 9 insertions, 4 deletions
diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs
index 1b6d5cf8ec..c752dba6a0 100644
--- a/compiler/typecheck/TcHsType.hs
+++ b/compiler/typecheck/TcHsType.hs
@@ -847,7 +847,7 @@ tcInstBinderX :: Maybe (VarEnv Kind)
tcInstBinderX mb_kind_info subst binder
| Just tv <- binderVar_maybe binder
= case lookup_tv tv of
- Just ki -> return (extendTCvSubst subst tv ki, ki)
+ Just ki -> return (extendTCvSubstAndInScope subst tv ki, ki)
Nothing -> do { (subst', tv') <- newMetaTyVarX subst tv
; return (subst', mkTyVarTy tv') }
diff --git a/compiler/typecheck/TcMType.hs b/compiler/typecheck/TcMType.hs
index a160d4ebfe..b7fe68c53c 100644
--- a/compiler/typecheck/TcMType.hs
+++ b/compiler/typecheck/TcMType.hs
@@ -693,7 +693,7 @@ newMetaTyVarX subst tyvar
-- See Note [Name of an instantiated type variable]
kind = substTyUnchecked subst (tyVarKind tyvar)
new_tv = mkTcTyVar name kind details
- ; return (extendTCvSubst (extendTCvInScope subst new_tv) tyvar
+ ; return (extendTCvSubstAndInScope subst tyvar
(mkTyVarTy new_tv)
, new_tv)
}
diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs
index a3e449dcfd..796c0429f6 100644
--- a/compiler/typecheck/TcType.hs
+++ b/compiler/typecheck/TcType.hs
@@ -145,6 +145,7 @@ module TcType (
mkOpenTCvSubst, zipOpenTCvSubst,
mkTopTCvSubst, notElemTCvSubst, unionTCvSubst,
getTvSubstEnv, setTvSubstEnv, getTCvInScope, extendTCvInScope,
+ extendTCvInScopeList, extendTCvInScopeSet, extendTCvSubstAndInScope,
Type.lookupTyVar, Type.extendTCvSubst, Type.substTyVarBndr,
extendTCvSubstList, isInScope, mkTCvSubst, zipTyEnv, zipCoEnv,
Type.substTy, substTys, substTyWith, substTyWithCoVars,
diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs
index 08d3b790eb..dcffbe037c 100644
--- a/compiler/types/TyCoRep.hs
+++ b/compiler/types/TyCoRep.hs
@@ -1864,7 +1864,11 @@ substTy subst@(TCvSubst in_scope tenv cenv) ty
| otherwise = ASSERT2( isValidTCvSubst subst,
text "in_scope" <+> ppr in_scope $$
text "tenv" <+> ppr tenv $$
+ text "tenvFVs"
+ <+> ppr (tyCoVarsOfTypes $ varEnvElts tenv) $$
text "cenv" <+> ppr cenv $$
+ text "cenvFVs"
+ <+> ppr (tyCoVarsOfCos $ varEnvElts cenv) $$
text "ty" <+> ppr ty )
ASSERT2( typeFVsInScope,
text "in_scope" <+> ppr in_scope $$
diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs
index 81e5773fa6..3992a7108c 100644
--- a/compiler/types/Type.hs
+++ b/compiler/types/Type.hs
@@ -154,8 +154,8 @@ module Type (
notElemTCvSubst,
getTvSubstEnv, setTvSubstEnv,
zapTCvSubst, getTCvInScope,
- extendTCvInScope, extendTCvInScopeList,
- extendTCvSubst, extendTCvSubstList,
+ extendTCvInScope, extendTCvInScopeList, extendTCvInScopeSet,
+ extendTCvSubst, extendTCvSubstList, extendTCvSubstAndInScope,
isInScope, composeTCvSubstEnv, composeTCvSubst, zipTyEnv, zipCoEnv,
isEmptyTCvSubst, unionTCvSubst,