Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/7679603b9898754c5830542cefc389fd14d0a559

>---------------------------------------------------------------

commit 7679603b9898754c5830542cefc389fd14d0a559
Author: Simon Marlow <marlo...@gmail.com>
Date:   Wed Apr 25 14:04:10 2012 +0100

    make -XNoImplicitPrelude work properly in GHCi

>---------------------------------------------------------------

 ghc/InteractiveUI.hs |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 75e8ca0..f2331b2 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -1720,12 +1720,11 @@ setGHCContextFromGHCiState = do
       -- the actual exception thrown by checkAdd, using tryBool to
       -- turn it into a Bool.
   iidecls <- filterM (tryBool.checkAdd) (transient_ctx st ++ remembered_ctx st)
-  GHC.setContext (maybeAddPrelude iidecls)
- where
-  maybeAddPrelude :: [InteractiveImport] -> [InteractiveImport]
-  maybeAddPrelude iidecls
-    | any isPreludeImport iidecls = iidecls
-    | otherwise                   = iidecls ++ [implicitPreludeImport]
+  dflags <- GHC.getSessionDynFlags
+  GHC.setContext $
+     if xopt Opt_ImplicitPrelude dflags && not (any isPreludeImport iidecls)
+        then iidecls ++ [implicitPreludeImport]
+        else iidecls
     -- XXX put prel at the end, so that guessCurrentModule doesn't pick it up.
 
 



_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to