[project @ 2000-10-31 09:58:13 by simonpj]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcIfaceSig.lhs
index 247b3b8..ed543f6 100644 (file)
@@ -15,9 +15,9 @@ import TcMonoType     ( tcHsType )
                                -- so tcHsType will do the Right Thing without
                                -- having to mess about with zonking
 
-import TcEnv           ( TcEnv, tcExtendTyVarEnv, 
+import TcEnv           ( TcEnv, RecTcEnv, tcExtendTyVarEnv, 
                          tcExtendGlobalValEnv, tcSetEnv,
-                         tcLookupGlobal_maybe, explicitLookupId, tcEnvIds
+                         tcLookupGlobal_maybe, tcLookupRecId, tcEnvIds
                        )
 
 import RnHsSyn         ( RenamedHsDecl )
@@ -51,7 +51,7 @@ As always, we do not have to worry about user-pragmas in interface
 signatures.
 
 \begin{code}
-tcInterfaceSigs :: TcEnv               -- Envt to use when checking unfoldings
+tcInterfaceSigs :: RecTcEnv            -- Envt to use when checking unfoldings
                -> [RenamedHsDecl]      -- Ignore non-sig-decls in these decls
                -> TcM [Id]
                
@@ -60,7 +60,9 @@ tcInterfaceSigs unf_env decls
   = listTc [ do_one name ty id_infos src_loc
           | TyClD (IfaceSig name ty id_infos src_loc) <- decls]
   where
-    in_scope_vars = filter isLocallyDefined (tcEnvIds unf_env)
+    in_scope_vars = [] -- I think this will be OK
+                       -- If so, don't pass it around
+                       -- Was: filter isLocallyDefined (tcEnvIds unf_env)
 
     do_one name ty id_infos src_loc
       = tcAddSrcLoc src_loc                            $       
@@ -108,11 +110,11 @@ tcWorkerInfo unf_env ty info worker_name
   = uniqSMToTcM (mkWrapper ty arity demands res_bot cpr_info) `thenNF_Tc` \ wrap_fn ->
     let
        -- Watch out! We can't pull on unf_env too eagerly!
-       info' = case explicitLookupId unf_env worker_name of
-                       Just worker_id -> info `setUnfoldingInfo`  mkTopUnfolding (wrap_fn worker_id)
-                                               `setWorkerInfo`     HasWorker worker_id arity
+       info' = case tcLookupRecId unf_env worker_name of
+                 Just worker_id -> info `setUnfoldingInfo`  mkTopUnfolding (wrap_fn worker_id)
+                                         `setWorkerInfo`     HasWorker worker_id arity
 
-                       Nothing        -> pprTrace "tcWorkerInfo failed:" (ppr worker_name) info
+                 Nothing        -> pprTrace "tcWorkerInfo failed:" (ppr worker_name) info
     in
     returnTc info'
   where
@@ -143,7 +145,7 @@ tcPragExpr unf_env name in_scope_vars expr
   where
     doc = text "unfolding of" <+> ppr name
 
-tcDelay :: TcEnv -> SDoc -> TcM a -> NF_TcM (Maybe a)
+tcDelay :: RecTcEnv -> SDoc -> TcM a -> NF_TcM (Maybe a)
 tcDelay unf_env doc thing_inside
   = forkNF_Tc (
        recoverNF_Tc bad_value (