Commit 4439532f authored by Simon Marlow's avatar Simon Marlow
Browse files

make GHCi use base:Prelude, not just Prelude

The module that GHCi uses for its default scope should be exactly
base:Prelude, not whatever Prelude is found on the search path.
parent 075a7bad
......@@ -260,7 +260,7 @@ interactiveUI session srcs maybe_expr = do
hSetBuffering stdin NoBuffering
-- initial context is just the Prelude
prel_mod <- GHC.findModule session prel_name Nothing
prel_mod <- GHC.findModule session prel_name (Just basePackageId)
GHC.setContext session [] [prel_mod]
......@@ -1929,7 +1929,7 @@ findModule' hsc_env mod_name maybe_pkg =
case lookupUFM hpt mod_name of
Just mod_info -> return (mi_module (hm_iface mod_info))
_not_a_home_module -> do
res <- findImportedModule hsc_env mod_name Nothing
res <- findImportedModule hsc_env mod_name maybe_pkg
case res of
Found _ m | modulePackageId m /= this_pkg -> return m
| otherwise -> throwDyn (CmdLineError (showSDoc $
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