fix panic in #1379
authorSimon Marlow <simonmar@microsoft.com>
Tue, 5 Jun 2007 08:44:38 +0000 (08:44 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Tue, 5 Jun 2007 08:44:38 +0000 (08:44 +0000)
compiler/ghci/InteractiveUI.hs
compiler/main/GHC.hs

index 5407293..ca8c050 100644 (file)
@@ -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 <>
index b57d0c8..f6a5134 100644 (file)
@@ -110,7 +110,7 @@ module GHC (
 
        -- ** Names
        Name, 
-       nameModule, pprParenSymName, nameSrcSpan,
+       isExternalName, nameModule, pprParenSymName, nameSrcSpan,
        NamedThing(..),
        RdrName(Qual,Unqual),