X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcBinds.lhs;h=4107d307ff41dca41e0ebaa3f1f38de5608a9029;hb=ee81425d0c684f5d2bffd4b647b0897df0539122;hp=b1bfc65a1ce9f278b11af5f712585cec1798ce37;hpb=bcacf0b79872953f5512c0ebd98d551a30306b49;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcBinds.lhs b/ghc/compiler/typecheck/TcBinds.lhs index b1bfc65..4107d30 100644 --- a/ghc/compiler/typecheck/TcBinds.lhs +++ b/ghc/compiler/typecheck/TcBinds.lhs @@ -11,7 +11,7 @@ module TcBinds ( tcBindsAndThen, tcTopBinds, tcHsBootSigs, tcMonoBinds, tcSpecSi import {-# SOURCE #-} TcMatches ( tcGRHSsPat, tcMatchesFun ) import {-# SOURCE #-} TcExpr ( tcCheckSigma, tcCheckRho ) -import CmdLineOpts ( DynFlag(Opt_MonomorphismRestriction) ) +import DynFlags ( DynFlag(Opt_MonomorphismRestriction) ) import HsSyn ( HsExpr(..), HsBind(..), LHsBinds, Sig(..), LSig, Match(..), HsBindGroup(..), IPBind(..), HsType(..), HsExplicitForAll(..), hsLTyVarNames, isVanillaLSig, @@ -40,11 +40,12 @@ import TcType ( TcTyVar, SkolemInfo(SigSkol), TcTauType, TcSigmaType, mkTyVarTy, mkForAllTys, mkFunTys, tyVarsOfType, mkForAllTy, isUnLiftedType, tcGetTyVar, - mkTyVarTys, tidyOpenTyVar, tidyOpenType ) + mkTyVarTys, tidyOpenTyVar ) import Kind ( argTypeKind ) import VarEnv ( TyVarEnv, emptyVarEnv, lookupVarEnv, extendVarEnv, emptyTidyEnv ) import TysPrim ( alphaTyVar ) -import Id ( mkLocalId, mkSpecPragmaId, setInlinePragma ) +import Id ( Id, mkLocalId, mkVanillaGlobal, mkSpecPragmaId, setInlinePragma ) +import IdInfo ( vanillaIdInfo ) import Var ( idType, idName ) import Name ( Name ) import NameSet @@ -106,18 +107,16 @@ tcTopBinds binds glue (HsIPBinds _) _ = panic "Top-level HsIpBinds" -- Can't have a HsIPBinds at top level -tcHsBootSigs :: [HsBindGroup Name] -> TcM (LHsBinds TcId, TcLclEnv) +tcHsBootSigs :: [HsBindGroup 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 [HsBindGroup _ sigs _] - = do { ids <- mapM (addLocM tc_sig) (filter isVanillaLSig sigs) - ; tcExtendIdEnv ids $ do - { env <- getLclEnv - ; return (emptyLHsBinds, env) }} + = mapM (addLocM tc_boot_sig) (filter isVanillaLSig sigs) where - tc_sig (Sig (L _ name) ty) + tc_boot_sig (Sig (L _ name) ty) = do { sigma_ty <- tcHsSigType (FunSigCtxt name) ty - ; return (mkLocalId name sigma_ty) } + ; return (mkVanillaGlobal name sigma_ty vanillaIdInfo) } + -- Notice that we make GlobalIds, not LocalIds tcBindsAndThen :: (HsBindGroup TcId -> thing -> thing) -- Combinator