summaryrefslogtreecommitdiff
path: root/compiler/GHC/Runtime
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-01-05 18:32:18 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-01-11 19:47:39 -0500
commitc2099059eca2f5f0217256374834784f008b7602 (patch)
tree515192aed0b2ea7688281aab187a8e7776e2ef66 /compiler/GHC/Runtime
parent35bea01b4df92f5c0bf875e8a8deed2252821f5b (diff)
downloadhaskell-c2099059eca2f5f0217256374834784f008b7602.tar.gz
RTTI: Substitute the [rk] skolems into kinds
(Fixes #10616 and #10617) Co-authored-by: Roland Senn <rsx@bluewin.ch>
Diffstat (limited to 'compiler/GHC/Runtime')
-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 c514cd105b..343f021a45 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