[project @ 2006-01-18 11:13:06 by simonpj]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcEnv.lhs
index 1c7e722..31d81a4 100644 (file)
@@ -63,7 +63,7 @@ import InstEnv                ( Instance, DFunId, instanceDFunId, instanceHead )
 import DataCon         ( DataCon )
 import TyCon           ( TyCon )
 import Class           ( Class )
-import Name            ( Name, NamedThing(..), getSrcLoc, nameModule )
+import Name            ( Name, NamedThing(..), getSrcLoc, nameModule, isExternalName )
 import PrelNames       ( thFAKE )
 import NameEnv
 import OccName         ( mkDFunOcc, occNameString )
@@ -93,9 +93,11 @@ tcLookupLocatedGlobal name
   = addLocM tcLookupGlobal name
 
 tcLookupGlobal :: Name -> TcM TyThing
+-- The Name is almost always an ExternalName, but not always
+-- In GHCi, we may make command-line bindings (ghci> let x = True)
+-- that bind a GlobalId, but with an InternalName
 tcLookupGlobal name
-  = ASSERT( isGlobalName name )
-    do { env <- getGblEnv
+  = do { env <- getGblEnv
        
                -- Try local envt
        ; case lookupNameEnv (tcg_type_env env) name of {