summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorRoland Senn <rsx@bluewin.ch>2018-12-24 14:14:25 +0100
committerBen Gamari <ben@smart-cactus.org>2019-01-16 14:10:49 -0500
commit9fb744bdc54c75cf5b91aa783b18233ba8da04a6 (patch)
tree935207b4a3b146bdb6817c34c666936dff86b512 /ghc
parentce2f77d5656e847e8411805906f736a4a0a1242e (diff)
downloadhaskell-9fb744bdc54c75cf5b91aa783b18233ba8da04a6.tar.gz
GHCi ignores cmd line flags XMonomorphismRestr.. XNoExtendedDef..#10857
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index d6d86fcecc..3a26dfefc8 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -433,9 +433,17 @@ interactiveUI config srcs maybe_exprs = do
-- The initial set of DynFlags used for interactive evaluation is the same
-- as the global DynFlags, plus -XExtendedDefaultRules and
-- -XNoMonomorphismRestriction.
+ -- However we set/unset these two extensions only, if they were not already
+ -- explicitely specified before. The function 'xopt_set_unlessExplSpec'
+ -- inspects the data field DynFlags.extensions.
+ -- At this point of the GHCi initialization this data field contains only
+ -- the extensions specified at the command line.
+ -- The ghci config file has not yet been processed. (#10857)
dflags <- getDynFlags
- let dflags' = (`xopt_set` LangExt.ExtendedDefaultRules)
- . (`xopt_unset` LangExt.MonomorphismRestriction)
+ let dflags' = (xopt_set_unlessExplSpec
+ LangExt.ExtendedDefaultRules xopt_set)
+ . (xopt_set_unlessExplSpec
+ LangExt.MonomorphismRestriction xopt_unset)
$ dflags
GHC.setInteractiveDynFlags dflags'