summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2017-12-26 12:28:39 +0000
committerBartosz Nitka <niteria@gmail.com>2017-12-26 12:29:21 +0000
commite19b6464cc8ea498775074a680f91d3e5b5636d3 (patch)
tree418396c9a63a206e7cafabc6bf0cc4a40a20ebca
parent02aaeabd585124f1394a3ad251b39b4ff368339b (diff)
downloadhaskell-e19b6464cc8ea498775074a680f91d3e5b5636d3.tar.gz
Compute InScopeSet in substInteractiveContext
It doesn't look like we keep any sets of free variables of the types of Ids handy, so we just have to build them when doing a substitution. Test Plan: buildbot + run testsuite with debug Reviewers: simonmar, simonpj, austin, bgamari Reviewed By: simonpj Subscribers: carter, rwbarton, thomie GHC Trac Issues: #11371 Differential Revision: https://phabricator.haskell.org/D3431
-rw-r--r--compiler/main/HscTypes.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs
index 16c8002380..165f860436 100644
--- a/compiler/main/HscTypes.hs
+++ b/compiler/main/HscTypes.hs
@@ -1711,8 +1711,13 @@ substInteractiveContext ictxt@InteractiveContext{ ic_tythings = tts } subst
| isEmptyTCvSubst subst = ictxt
| otherwise = ictxt { ic_tythings = map subst_ty tts }
where
- subst_ty (AnId id) = AnId $ id `setIdType` substTyUnchecked subst (idType id)
- subst_ty tt = tt
+ subst_ty (AnId id)
+ = AnId $ id `setIdType` substTyAddInScope subst (idType id)
+ -- Variables in the interactive context *can* mention free type variables
+ -- because of the runtime debugger. Otherwise you'd expect all
+ -- variables bound in the interactive context to be closed.
+ subst_ty tt
+ = tt
instance Outputable InteractiveImport where
ppr (IIModule m) = char '*' <> ppr m