Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
2899aa58
Commit
2899aa58
authored
Jan 25, 2016
by
eir@cis.upenn.edu
Browse files
Fix some substitution InScopeSets
This is relevant to
#11371
.
parent
4faa1a63
Changes
5
Hide whitespace changes
Inline
Side-by-side
compiler/typecheck/TcHsType.hs
View file @
2899aa58
...
...
@@ -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
(
extendTCvSubst
AndInScope
subst
tv
ki
,
ki
)
Nothing
->
do
{
(
subst'
,
tv'
)
<-
newMetaTyVarX
subst
tv
;
return
(
subst'
,
mkTyVarTy
tv'
)
}
...
...
compiler/typecheck/TcMType.hs
View file @
2899aa58
...
...
@@ -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
(
extendTCv
InScope
subst
new_tv
)
tyvar
;
return
(
extendTCvSubst
And
InScope
subst
tyvar
(
mkTyVarTy
new_tv
)
,
new_tv
)
}
...
...
compiler/typecheck/TcType.hs
View file @
2899aa58
...
...
@@ -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
,
...
...
compiler/types/TyCoRep.hs
View file @
2899aa58
...
...
@@ -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
$$
...
...
compiler/types/Type.hs
View file @
2899aa58
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment