From: Simon Marlow Date: Tue, 5 Jun 2007 08:44:38 +0000 (+0000) Subject: fix panic in #1379 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=1a74e14655acb56919ac74bd92c116c7d01d7c30 fix panic in #1379 --- diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index 5407293..ca8c050 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -1471,6 +1471,10 @@ wantNameFromInterpretedModule noCanDo str and_then = do [] -> return () (n:_) -> do let modl = GHC.nameModule n + if not (GHC.isExternalName n) + then noCanDo n $ ppr n <> + text " is not defined in an interpreted module" + else do is_interpreted <- io (GHC.moduleIsInterpreted session modl) if not is_interpreted then noCanDo n $ text "module " <> ppr modl <> diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index b57d0c8..f6a5134 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -110,7 +110,7 @@ module GHC ( -- ** Names Name, - nameModule, pprParenSymName, nameSrcSpan, + isExternalName, nameModule, pprParenSymName, nameSrcSpan, NamedThing(..), RdrName(Qual,Unqual),