summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-01-07 11:39:19 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-01-11 19:43:57 -0500
commit833216a31c866d86ff95cfbf95591fb56463371c (patch)
treec1207669ca0c024b3f517a197a1313d81ee8437a /ghc
parent23d215fcb62c8bfe8d56396a0c9718a72ac0037b (diff)
downloadhaskell-833216a31c866d86ff95cfbf95591fb56463371c.tar.gz
Use interactive flags when printing expressions in GHCi
The documentation states that the interactive flags should be use for any interactive expressions. The interactive flags are used when typechecking these expressions but not when printing. The session flags (modified by :set) are only used when loading a module. Fixes #20909
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI/Monad.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/ghc/GHCi/UI/Monad.hs b/ghc/GHCi/UI/Monad.hs
index 157b9e8950..3aead3e91e 100644
--- a/ghc/GHCi/UI/Monad.hs
+++ b/ghc/GHCi/UI/Monad.hs
@@ -344,12 +344,12 @@ unsetOption opt
printForUserNeverQualify :: GhcMonad m => SDoc -> m ()
printForUserNeverQualify doc = do
- dflags <- getDynFlags
+ dflags <- GHC.getInteractiveDynFlags
liftIO $ Ppr.printForUser dflags stdout neverQualify AllTheWay doc
printForUserModInfo :: GhcMonad m => GHC.ModuleInfo -> SDoc -> m ()
printForUserModInfo info doc = do
- dflags <- getDynFlags
+ dflags <- GHC.getInteractiveDynFlags
mUnqual <- GHC.mkPrintUnqualifiedForModule info
unqual <- maybe GHC.getPrintUnqual return mUnqual
liftIO $ Ppr.printForUser dflags stdout unqual AllTheWay doc
@@ -357,13 +357,13 @@ printForUserModInfo info doc = do
printForUser :: GhcMonad m => SDoc -> m ()
printForUser doc = do
unqual <- GHC.getPrintUnqual
- dflags <- getDynFlags
+ dflags <- GHC.getInteractiveDynFlags
liftIO $ Ppr.printForUser dflags stdout unqual AllTheWay doc
printForUserPartWay :: GhcMonad m => SDoc -> m ()
printForUserPartWay doc = do
unqual <- GHC.getPrintUnqual
- dflags <- getDynFlags
+ dflags <- GHC.getInteractiveDynFlags
liftIO $ Ppr.printForUser dflags stdout unqual DefaultDepth doc
-- | Run a single Haskell expression