[project @ 2004-11-18 00:56:18 by igloo]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcRnDriver.lhs
index 9d34979..676792b 100644 (file)
@@ -84,7 +84,7 @@ import TcHsSyn                ( mkHsLet, zonkTopLExpr, zonkTopBndrs )
 import TcHsType                ( kcHsType )
 import TcExpr          ( tcCheckRho )
 import TcIface         ( loadImportedInsts )
-import TcMType         ( zonkTcType )
+import TcMType         ( zonkTcType, zonkQuantifiedTyVar )
 import TcUnify         ( unifyTyConApp )
 import TcMatches       ( tcStmtsAndThen, TcStmtCtxt(..) )
 import TcSimplify      ( tcSimplifyInteractive, tcSimplifyInfer )
@@ -161,9 +161,10 @@ tcRnModule hsc_env (L loc (HsModule maybe_mod exports
    do {        -- Deal with imports; sets tcg_rdr_env, tcg_imports
        (rdr_env, imports) <- rnImports import_decls ;
 
-               -- In one-shot mode, record boot-file info in the EPS
-       ifM (isOneShot (hsc_mode hsc_env)) $
-           updateEps_ (\eps -> eps { eps_is_boot = imp_dep_mods imports }) ;
+               -- Record boot-file info in the EPS, so that it's 
+               -- visible to loadHiBootInterface in tcRnSrcDecls,
+               -- and any other incrementally-performed imports
+       updateEps_ (\eps -> eps { eps_is_boot = imp_dep_mods imports }) ;
 
                -- Update the gbl env
        updGblEnv ( \ gbl -> gbl { tcg_rdr_env = rdr_env,
@@ -423,6 +424,8 @@ the hi-boot interface as our checklist.
 checkHiBootIface :: TypeEnv -> [Name] -> TcM ()
 -- Compare the hi-boot file for this module (if there is one)
 -- with the type environment we've just come up with
+-- In the common case where there is no hi-boot file, the list
+-- of boot_names is empty.
 checkHiBootIface env boot_names
   = mapM_ (check_one env) boot_names
 
@@ -900,8 +903,9 @@ tcRnExpr hsc_env ictxt rdr_expr
     ((tc_expr, res_ty), lie)      <- getLIE (tcInferRho rn_expr) ;
     ((qtvs, _, dict_ids), lie_top) <- getLIE (tcSimplifyInfer smpl_doc (tyVarsOfType res_ty) lie)  ;
     tcSimplifyInteractive lie_top ;
+    qtvs' <- mappM zonkQuantifiedTyVar qtvs ;
 
-    let { all_expr_ty = mkForAllTys qtvs               $
+    let { all_expr_ty = mkForAllTys qtvs' $
                        mkFunTys (map idType dict_ids)  $
                        res_ty } ;
     zonkTcType all_expr_ty