Commit 7679603b authored by Simon Marlow's avatar Simon Marlow

make -XNoImplicitPrelude work properly in GHCi

parent 84d79a2a
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment