From: Simon Marlow Date: Tue, 27 Mar 2007 15:45:54 +0000 (+0000) Subject: make GHCi use base:Prelude, not just Prelude X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=4439532f2c5edaab6cb360549c0f29e884d56675 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. --- diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index b5af439..cea3b29 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -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 diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 2167035..c5740d2 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -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 $