From: simonpj Date: Thu, 11 Aug 2005 09:20:50 +0000 (+0000) Subject: [project @ 2005-08-11 09:20:49 by simonpj] X-Git-Tag: Initial_conversion_from_CVS_complete~247 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=81d9bd68cd5bc763ef7d675d5263f210e7dca9c0;p=ghc-hetmet.git [project @ 2005-08-11 09:20:49 by simonpj] Further wibbles to moving dependency analysis back to renamer; fixes ghci failures --- diff --git a/ghc/compiler/typecheck/TcBinds.lhs b/ghc/compiler/typecheck/TcBinds.lhs index ec6e0e8..a4d163a 100644 --- a/ghc/compiler/typecheck/TcBinds.lhs +++ b/ghc/compiler/typecheck/TcBinds.lhs @@ -20,7 +20,7 @@ import HsSyn ( HsExpr(..), HsBind(..), LHsBinds, LHsBind, Sig(..), LSig, Match(..), IPBind(..), Prag(..), HsType(..), LHsType, HsExplicitForAll(..), hsLTyVarNames, isVanillaLSig, sigName, placeHolderNames, isPragLSig, - LPat, GRHSs, MatchGroup(..), isEmptyLHsBinds, pprLHsBinds, + LPat, GRHSs, MatchGroup(..), pprLHsBinds, collectHsBindBinders, collectPatBinders, pprPatBind ) import TcHsSyn ( zonkId, (<$>) ) @@ -113,8 +113,8 @@ tcTopBinds binds tcHsBootSigs :: HsValBinds Name -> TcM [Id] -- A hs-boot file has only one BindGroup, and it only has type -- signatures in it. The renamer checked all this -tcHsBootSigs (ValBindsIn binds sigs) - = do { checkTc (isEmptyLHsBinds binds) badBootDeclErr +tcHsBootSigs (ValBindsOut binds sigs) + = do { checkTc (null binds) badBootDeclErr ; mapM (addLocM tc_boot_sig) (filter isVanillaLSig sigs) } where tc_boot_sig (Sig (L _ name) ty) diff --git a/ghc/compiler/typecheck/TcDeriv.lhs b/ghc/compiler/typecheck/TcDeriv.lhs index 326580b..3974bf0 100644 --- a/ghc/compiler/typecheck/TcDeriv.lhs +++ b/ghc/compiler/typecheck/TcDeriv.lhs @@ -209,7 +209,7 @@ tcDeriving :: [LTyClDecl Name] -- All type constructors HsValBinds Name) -- Extra generated top-level bindings tcDeriving tycl_decls - = recoverM (returnM ([], emptyValBindsIn)) $ + = recoverM (returnM ([], emptyValBindsOut)) $ do { -- Fish the "deriving"-related information out of the TcEnv -- and make the necessary "equations". overlap_flag <- getOverlapFlag @@ -227,7 +227,7 @@ tcDeriving tycl_decls -- don't generate any derived bindings ; is_boot <- tcIsHsBoot ; if is_boot then - return (inst_info, emptyValBindsIn) + return (inst_info, emptyValBindsOut) else do { diff --git a/ghc/compiler/typecheck/TcRnDriver.lhs b/ghc/compiler/typecheck/TcRnDriver.lhs index fb7f803..dc22e67 100644 --- a/ghc/compiler/typecheck/TcRnDriver.lhs +++ b/ghc/compiler/typecheck/TcRnDriver.lhs @@ -121,7 +121,7 @@ import PrelNames ( iNTERACTIVE, ioTyConName, printName, itName, import HscTypes ( InteractiveContext(..), ModIface(..), icPrintUnqual, Dependencies(..) ) -import BasicTypes ( Fixity ) +import BasicTypes ( Fixity, RecFlag(..) ) import SrcLoc ( unLoc ) #endif @@ -952,7 +952,7 @@ mkPlan (L loc (ExprStmt expr _ _)) -- An expression typed at the prompt ; let fresh_it = itName uniq the_bind = L loc $ FunBind (L loc fresh_it) False matches emptyNameSet matches = mkMatchGroup [mkMatch [] expr emptyLocalBinds] - let_stmt = L loc $ LetStmt (HsValBinds (ValBindsIn (unitBag the_bind) [])) + let_stmt = L loc $ LetStmt (HsValBinds (ValBindsOut [(NonRecursive,unitBag the_bind)] [])) bind_stmt = L loc $ BindStmt (nlVarPat fresh_it) expr (HsVar bindIOName) noSyntaxExpr print_it = L loc $ ExprStmt (nlHsApp (nlHsVar printName) (nlHsVar fresh_it))