From 1a74e14655acb56919ac74bd92c116c7d01d7c30 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 5 Jun 2007 08:44:38 +0000 Subject: [PATCH] fix panic in #1379 --- compiler/ghci/InteractiveUI.hs | 4 ++++ compiler/main/GHC.hs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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), -- 1.7.10.4