diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2019-11-08 09:22:02 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2019-11-08 10:39:19 +0000 |
commit | 6ed583b6eda7488912c2b7f88080451c8dc6ac11 (patch) | |
tree | c88cb1cb5907a76f7c8adb5b11f1114603a6a909 /compiler | |
parent | a3ce52fd5704247de2360f0e8423834113fe3a71 (diff) | |
download | haskell-wip/T17431.tar.gz |
Use the right type in :forcewip/T17431
A missing prime meant that we were considering the wrong
type in the GHCi debugger, when doing :force on multiple
arguments (issue #17431).
The fix is trivial.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ghci/Debugger.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/ghci/Debugger.hs b/compiler/ghci/Debugger.hs index d803c0b729..a9bf9a87e9 100644 --- a/compiler/ghci/Debugger.hs +++ b/compiler/ghci/Debugger.hs @@ -74,7 +74,8 @@ pprintClosureCommand bindThings force str = do -- Do the obtainTerm--bindSuspensions-computeSubstitution dance go :: GhcMonad m => TCvSubst -> Id -> m (TCvSubst, Term) go subst id = do - let id' = id `setIdType` substTy subst (idType id) + let id_ty' = substTy subst (idType id) + id' = id `setIdType` id_ty' term_ <- GHC.obtainTermFromId maxBound force id' term <- tidyTermTyVars term_ term' <- if bindThings @@ -85,13 +86,14 @@ pprintClosureCommand bindThings force str = do -- mapping the old tyvars to the reconstructed types. let reconstructed_type = termType term hsc_env <- getSession - case (improveRTTIType hsc_env (idType id) (reconstructed_type)) of + case (improveRTTIType hsc_env id_ty' reconstructed_type) of Nothing -> return (subst, term') Just subst' -> do { dflags <- GHC.getSessionDynFlags ; liftIO $ dumpIfSet_dyn dflags Opt_D_dump_rtti "RTTI" (fsep $ [text "RTTI Improvement for", ppr id, - text "is the substitution:" , ppr subst']) + text "old substitution:" , ppr subst, + text "new substitution:" , ppr subst']) ; return (subst `unionTCvSubst` subst', term')} tidyTermTyVars :: GhcMonad m => Term -> m Term |