X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcRnDriver.lhs;h=64b9491f2e3b7c49fa370b44b11e0e8d8b8d0ee0;hb=37e0de2d206743f41ef7e2fe24d77e842eefaa5c;hp=6e65eec309e5a51b78821c9816a8d0ce6b3718b3;hpb=84ed91abfe3f9df43d5b33e404138e43a574beb8;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcRnDriver.lhs b/ghc/compiler/typecheck/TcRnDriver.lhs index 6e65eec..64b9491 100644 --- a/ghc/compiler/typecheck/TcRnDriver.lhs +++ b/ghc/compiler/typecheck/TcRnDriver.lhs @@ -28,7 +28,7 @@ import HsSyn ( HsModule(..), HsBinds(..), MonoBinds(..), HsExpr(..), isSrcRule, collectStmtsBinders ) import RdrHsSyn ( RdrNameHsModule, RdrNameHsDecl, RdrNameStmt, RdrNameHsExpr, - emptyGroup, mkGroup, findSplice, addImpDecls ) + emptyGroup, mkGroup, findSplice, addImpDecls, main_RDR_Unqual ) import PrelNames ( iNTERACTIVE, ioTyConName, printName, returnIOName, bindIOName, failIOName, thenIOName, runIOName, @@ -45,7 +45,7 @@ import TcHsSyn ( TypecheckedHsExpr, TypecheckedRuleDecl, zonkTopExpr, zonkTopBndrs ) -import TcExpr ( tcExpr_id ) +import TcExpr ( tcInferRho ) import TcRnMonad import TcMType ( newTyVarTy, zonkTcType ) import TcType ( Type, liftedTypeKind, @@ -70,7 +70,7 @@ import TcSimplify ( tcSimplifyTop, tcSimplifyInfer ) import TcTyClsDecls ( tcTyAndClassDecls ) import RnNames ( importsFromLocalDecls, rnImports, exportsFromAvail, - reportUnusedNames, main_RDR_Unqual ) + reportUnusedNames ) import RnIfaces ( slurpImpDecls, checkVersions, RecompileRequired, outOfDate ) import RnHiFiles ( readIface, loadOldIface ) import RnEnv ( lookupSrcName, lookupOccRn, plusGlobalRdrEnv, @@ -444,8 +444,7 @@ tcRnExpr hsc_env pcs ictxt rdr_expr -- Now typecheck the expression; -- it might have a rank-2 type (e.g. :t runST) - -- Hence the hole type (c.f. TcExpr.tcExpr_id) - ((tc_expr, res_ty), lie) <- getLIE (tcExpr_id rn_expr) ; + ((tc_expr, res_ty), lie) <- getLIE (tcInferRho rn_expr) ; ((qtvs, _, dict_ids), lie_top) <- getLIE (tcSimplifyInfer smpl_doc (tyVarsOfType res_ty) lie) ; tcSimplifyTop lie_top ; @@ -679,7 +678,7 @@ tc_rn_src_decls ds -- Glue them on the front of the remaining decls and loop (tc_envs, src_dus2) <- tc_rn_src_decls (spliced_decls ++ rest_ds) ; - return (tcg_envs, src_dus1 `plusDU` usesOnly splice_fvs `plusDU` src_dus2) + return (tc_envs, src_dus1 `plusDU` usesOnly splice_fvs `plusDU` src_dus2) } #endif /* GHCI */ }}} @@ -707,16 +706,13 @@ monad; it augments it and returns the new TcGblEnv. tcRnGroup :: HsGroup RdrName -> TcM ((TcGblEnv, TcLclEnv), DefUses) -- Returns the variables free in the decls, for unused-binding reporting tcRnGroup decls - = do { showLIE (text "LIE at start of tcRnGroup" <+> ppr decls) ; - - -- Rename the declarations + = do { -- Rename the declarations (tcg_env, rn_decls, src_dus) <- rnTopSrcDecls decls ; setGblEnv tcg_env $ do { -- Typecheck the declarations tc_envs <- tcTopSrcDecls rn_decls ; - showLIE (text "LIE at end of tcRnGroup" <+> ppr decls) ; return (tc_envs, src_dus) }} @@ -1119,7 +1115,7 @@ check_main ghci_mode tcg_env -- $main :: IO () = runIO main let { rhs = HsApp (HsVar runIOName) (HsVar main_name) } ; - (main_expr, ty) <- tcExpr_id rhs ; + (main_expr, ty) <- tcInferRho rhs ; let { dollar_main_id = setIdLocalExported (mkLocalId dollarMainName ty) ; main_bind = VarMonoBind dollar_main_id main_expr ;