make GHCi use base:Prelude, not just Prelude
authorSimon Marlow <simonmar@microsoft.com>
Tue, 27 Mar 2007 15:45:54 +0000 (15:45 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Tue, 27 Mar 2007 15:45:54 +0000 (15:45 +0000)
The module that GHCi uses for its default scope should be exactly
base:Prelude, not whatever Prelude is found on the search path.

compiler/ghci/InteractiveUI.hs
compiler/main/GHC.hs

index b5af439..cea3b29 100644 (file)
@@ -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]
 
 #ifdef USE_READLINE
index 2167035..c5740d2 100644 (file)
@@ -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 $