summaryrefslogtreecommitdiff
path: root/compiler/main/GHC.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-09-07 10:48:43 -0400
committerBen Gamari <ben@smart-cactus.org>2018-09-12 18:06:44 -0400
commit7ab80072ad63fa9eb1d77bd579af720bf24b25a4 (patch)
treebe6f2f271e0f6de1d235ad537abc645b08b6b882 /compiler/main/GHC.hs
parent0e6d42fe76958648243f99c49e648769c1ea658c (diff)
downloadhaskell-7ab80072ad63fa9eb1d77bd579af720bf24b25a4.tar.gz
Revert "ghc: Remove warning of StaticPointers not being supported by GHCi"
While we now support use of StaticPointers in modules loaded via the REPL (e.g. via `:load`), we currently do not support use of StaticPointers on the REPL itself. This reverts commit 9400a5c6b308fbb5b3a73690610736ca3b5eb0b3.
Diffstat (limited to 'compiler/main/GHC.hs')
-rw-r--r--compiler/main/GHC.hs15
1 files changed, 12 insertions, 3 deletions
diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs
index 4059860680..cf9c74f885 100644
--- a/compiler/main/GHC.hs
+++ b/compiler/main/GHC.hs
@@ -332,7 +332,7 @@ import Annotations
import Module
import Panic
import Platform
-import Bag ( unitBag )
+import Bag ( listToBag, unitBag )
import ErrUtils
import MonadUtils
import Util
@@ -344,6 +344,7 @@ import FastString
import qualified Parser
import Lexer
import ApiAnnotation
+import qualified GHC.LanguageExtensions as LangExt
import NameEnv
import CoreFVs ( orphNamesOfFamInst )
import FamInstEnv ( famInstEnvElts )
@@ -676,8 +677,16 @@ checkNewDynFlags dflags = do
checkNewInteractiveDynFlags :: MonadIO m => DynFlags -> m DynFlags
checkNewInteractiveDynFlags dflags0 = do
- -- Nothing to be done here
- return dflags0
+ -- We currently don't support use of StaticPointers in expressions entered on
+ -- the REPL. See #12356.
+ dflags1 <-
+ if xopt LangExt.StaticPointers dflags0
+ then do liftIO $ printOrThrowWarnings dflags0 $ listToBag
+ [mkPlainWarnMsg dflags0 interactiveSrcSpan
+ $ text "StaticPointers is not supported in GHCi interactive expressions."]
+ return $ xopt_unset dflags0 LangExt.StaticPointers
+ else return dflags0
+ return dflags1
-- %************************************************************************