#endif
tcRnModule,
tcTopSrcDecls,
- tcRnIface, tcRnExtCore
+ tcRnExtCore
) where
#include "HsVersions.h"
import TcRules ( tcRules )
import TcForeign ( tcForeignImports, tcForeignExports )
import TcInstDcls ( tcInstDecls1, tcInstDecls2 )
-import TcIface ( typecheckIface, tcExtCoreBindings )
+import TcIface ( tcExtCoreBindings )
import TcSimplify ( tcSimplifyTop )
import TcTyClsDecls ( tcTyAndClassDecls )
import LoadIface ( loadOrphanModules )
\end{code}
-%*********************************************************
-%* *
-\subsection{Closing up the interface decls}
-%* *
-%*********************************************************
-
-Suppose we discover we don't need to recompile. Then we start from the
-IfaceDecls in the ModIface, and fluff them up by sucking in all the decls they need.
-
-\begin{code}
-tcRnIface :: HscEnv
- -> ModIface -- Get the decls from here
- -> IO ModDetails
-tcRnIface hsc_env iface
- = initIfaceTc hsc_env iface (typecheckIface iface)
-\end{code}
-
-
%************************************************************************
%* *
The interactive interface
-- Rename the splice expression, and get its supporting decls
(rn_splice_expr, splice_fvs) <- addSrcLoc splice_loc $
rnExpr splice_expr ;
+ failIfErrsM ; -- Don't typecheck if renaming failed
+
-- Execute the splice
spliced_decls <- tcSpliceDecls rn_splice_expr ;
\begin{code}
#ifdef GHCI
mkExportEnv :: HscEnv -> [ModuleName] -- Expose these modules' exports only
- -> IO (Maybe GlobalRdrEnv)
+ -> IO GlobalRdrEnv
mkExportEnv hsc_env exports
- = initTc hsc_env iNTERACTIVE $ do {
- export_envs <- mappM getModuleExports exports ;
- returnM (foldr plusGlobalRdrEnv emptyGlobalRdrEnv export_envs)
+ = do { mb_envs <- initTc hsc_env iNTERACTIVE $
+ mappM getModuleExports exports
+ ; case mb_envs of
+ Just envs -> return (foldr plusGlobalRdrEnv emptyGlobalRdrEnv envs)
+ Nothing -> return emptyGlobalRdrEnv
+ -- Some error; initTc will have printed it
}
getModuleExports :: ModuleName -> TcM GlobalRdrEnv
let { main_mod = case mb_main_mod of {
Just mod -> mkModuleName mod ;
Nothing -> mAIN_Name } ;
- main_fn = case mb_main_fn of {
+ main_fn = case mb_main_fn of {
Just fn -> mkRdrUnqual (mkVarOcc (mkFastString fn)) ;
Nothing -> main_RDR_Unqual } } ;