summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-04-25 15:34:01 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-04-25 15:34:01 +0100
commit3b528914877a8d45c2487988f05e6ecc092bebf1 (patch)
treee0cfc9ec1de07610e5d4b6a719a90da250db47f2
parentebd7226a44b8adea618adf007a55dae497846496 (diff)
parent7679603b9898754c5830542cefc389fd14d0a559 (diff)
downloadhaskell-3b528914877a8d45c2487988f05e6ecc092bebf1.tar.gz
Merge branch 'master' of http://darcs.haskell.org/ghc
-rw-r--r--ghc.mk2
-rw-r--r--ghc/InteractiveUI.hs11
2 files changed, 6 insertions, 7 deletions
diff --git a/ghc.mk b/ghc.mk
index d975425cee..e0797ee742 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -1234,7 +1234,7 @@ distclean : clean
$(call removeFiles,libraries/process/include/HsProcessConfig.h)
$(call removeFiles,libraries/unix/include/HsUnixConfig.h)
$(call removeFiles,libraries/old-time/include/HsTimeConfig.h)
- $(call removeTrees,utils/ghc-pwd/dist)
+ $(call removeTrees,utils/ghc-pwd/dist-boot)
$(call removeTrees,inplace)
$(call removeTrees,$(patsubst %, libraries/%/autom4te.cache, $(PACKAGES_STAGE1) $(PACKAGES_STAGE2)))
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 75e8ca0f67..f2331b24cf 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.