summaryrefslogtreecommitdiff
path: root/compiler/GHC
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-01-05 18:32:18 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2022-01-10 10:55:34 +0000
commit057cf18a0e43acea9e861df7ac56710098a0d1b0 (patch)
tree13a63378af5463cda97373974306b211777b89bb /compiler/GHC
parentf583eb8e5e7077f77fba035a454fafd945d4a4ea (diff)
downloadhaskell-wip/T10617.tar.gz
RTTI: Substitute the [rk] skolems into kindswip/T10617
(Fixes #10616 and #10617) Co-authored-by: Roland Senn <rsx@bluewin.ch>
Diffstat (limited to 'compiler/GHC')
-rw-r--r--compiler/GHC/Runtime/Eval.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/GHC/Runtime/Eval.hs b/compiler/GHC/Runtime/Eval.hs
index 3d4e92d438..f624a45086 100644
--- a/compiler/GHC/Runtime/Eval.hs
+++ b/compiler/GHC/Runtime/Eval.hs
@@ -573,7 +573,7 @@ bindLocalsAtBreakpoint hsc_env apStack_fhv (Just BreakInfo{..}) = do
(ids, offsets, occs') = syncOccs mbPointers occs
- free_tvs = tyCoVarsOfTypesList (result_ty:map idType ids)
+ free_tvs = tyCoVarsOfTypesWellScoped (result_ty:map idType ids)
-- It might be that getIdValFromApStack fails, because the AP_STACK
-- has been accidentally evaluated, or something else has gone wrong.
@@ -623,10 +623,11 @@ bindLocalsAtBreakpoint hsc_env apStack_fhv (Just BreakInfo{..}) = do
newTyVars :: UniqSupply -> [TcTyVar] -> TCvSubst
-- Similarly, clone the type variables mentioned in the types
-- we have here, *and* make them all RuntimeUnk tyvars
- newTyVars us tvs
- = mkTvSubstPrs [ (tv, mkTyVarTy (mkRuntimeUnkTyVar name (tyVarKind tv)))
- | (tv, uniq) <- tvs `zip` uniqsFromSupply us
- , let name = setNameUnique (tyVarName tv) uniq ]
+ newTyVars us tvs = foldl' new_tv emptyTCvSubst (tvs `zip` uniqsFromSupply us)
+ new_tv subst (tv,uniq) = extendTCvSubstWithClone subst tv new_tv
+ where
+ new_tv = mkRuntimeUnkTyVar (setNameUnique (tyVarName tv) uniq)
+ (substTy subst (tyVarKind tv))
isPointer id | [rep] <- typePrimRep (idType id)
, isGcPtrRep rep = True