diff options
author | Roland Senn <rsx@bluewin.ch> | 2019-01-28 10:53:50 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-01-28 16:53:59 -0500 |
commit | 7cdcd3e12a5c3a337e36fa80c64bd72e5ef79b24 (patch) | |
tree | 6e5e940cb2c6ae9110807fa0d637a280c63b4220 /ghc | |
parent | b1e569a54085bf1093b4f858f8c7c739e3be769b (diff) | |
download | haskell-7cdcd3e12a5c3a337e36fa80c64bd72e5ef79b24.tar.gz |
Fix #12509: ghci -XSafe fails in an inscrutable way
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GHCi/UI/Monad.hs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ghc/GHCi/UI/Monad.hs b/ghc/GHCi/UI/Monad.hs index 8f60dfbb7e..dddbe824d6 100644 --- a/ghc/GHCi/UI/Monad.hs +++ b/ghc/GHCi/UI/Monad.hs @@ -511,10 +511,15 @@ compileGHCiExpr expr = withTempSession mkTempSession $ GHC.compileExprRemote expr where mkTempSession hsc_env = hsc_env - { hsc_dflags = (hsc_dflags hsc_env) - -- RebindableSyntax can wreak havoc with GHCi in several ways - -- (see #13385 and #14342 for examples), so we take care to disable it - -- for the duration of running expressions that are internal to GHCi. + { hsc_dflags = (hsc_dflags hsc_env) { + -- Running GHCi's internal expression is incompatible with -XSafe. + -- We temporarily disable any Safe Haskell settings while running + -- GHCi internal expressions. (see #12509) + safeHaskell = Sf_None + } + -- RebindableSyntax can wreak havoc with GHCi in several ways + -- (see #13385 and #14342 for examples), so we temporarily + -- disable it too. `xopt_unset` LangExt.RebindableSyntax -- We heavily depend on -fimplicit-import-qualified to compile expr -- with fully qualified names without imports. |