summaryrefslogtreecommitdiff
path: root/ghc/GHCi/UI.hs
diff options
context:
space:
mode:
authorHE, Tao <sighingnow@gmail.com>2018-06-14 09:14:58 -0400
committerBen Gamari <ben@smart-cactus.org>2018-06-14 10:03:28 -0400
commit4a931665e41be2621abe4458b64190123109b746 (patch)
tree1b57669d8317739281073f8c9a07ed5dd7bc5888 /ghc/GHCi/UI.hs
parent0238a6c78102d43dae2f56192bd3486e4f9ecf1d (diff)
downloadhaskell-4a931665e41be2621abe4458b64190123109b746.tar.gz
Disable `-fdefer-out-of-scope-variables` in ghci.
We have already disabled `-fdefer-type-errors` and `-fdefer-typed-holes` in ghci. This patch disables `-fdefer-out-of-scope-variables` as well. Fixes Trac #15259, as well as #14963. Test Plan: make test TEST="T15259 T14963a T14963b T14963c" Reviewers: bgamari, tdammers Reviewed By: tdammers Subscribers: tdammers, rwbarton, thomie, carter GHC Trac Issues: #15259, #14963 Differential Revision: https://phabricator.haskell.org/D4830
Diffstat (limited to 'ghc/GHCi/UI.hs')
-rw-r--r--ghc/GHCi/UI.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 7c427a03a8..15cfcf3362 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -1085,6 +1085,10 @@ enqueueCommands cmds = do
runStmt :: String -> SingleStep -> GHCi (Maybe GHC.ExecResult)
runStmt stmt step = do
dflags <- GHC.getInteractiveDynFlags
+ -- In GHCi, we disable `-fdefer-type-errors`, as well as `-fdefer-type-holes`
+ -- and `-fdefer-out-of-scope-variables` for **naked expressions**. The
+ -- declarations and statements are not affected.
+ -- See Note [Deferred type errors in GHCi] in typecheck/TcRnDriver.hs
if | GHC.isStmt dflags stmt -> run_stmt
| GHC.isImport dflags stmt -> run_import
-- Every import declaration should be handled by `run_import`. As GHCi