diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-03-04 23:19:42 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-03-04 23:19:42 -0500 |
commit | 3a1210f20915702983e4750a280daf8892e51c31 (patch) | |
tree | 06389fa7929716b8cc2a41abafc85f52d9988a0a | |
parent | c32dcb8fdaa45dc0f56dc1dda935a7ef15970327 (diff) | |
download | haskell-3a1210f20915702983e4750a280daf8892e51c31.tar.gz |
-rw-r--r-- | compiler/deSugar/Desugar.hs | 10 | ||||
-rw-r--r-- | compiler/iface/TcIface.hs | 8 | ||||
-rw-r--r-- | compiler/iface/TcIface.hs-boot | 1 |
3 files changed, 9 insertions, 10 deletions
diff --git a/compiler/deSugar/Desugar.hs b/compiler/deSugar/Desugar.hs index 5bec60e034..1e1aa9233f 100644 --- a/compiler/deSugar/Desugar.hs +++ b/compiler/deSugar/Desugar.hs @@ -418,14 +418,14 @@ dsRule _ = panic "dsRule: Impossible Match" -- due to #15884 warnRuleShadowing :: RuleName -> Activation -> Id -> [Id] -> DsM () -- See Note [Rules and inlining/other rules] warnRuleShadowing rule_name rule_act fn_id arg_ids - = do { check False fn_id -- We often have multiple rules for the same Id in a - -- module. Maybe we should check that they don't overlap - -- but currently we don't - ; dflags <- getDynFlags + = do { dflags <- getDynFlags + ; check dflags False fn_id -- We often have multiple rules for the same Id in a + -- module. Maybe we should check that they don't overlap + -- but currently we don't ; mapM_ (check dflags True) arg_ids } where check dflags check_rules_too lhs_id - | isLocalId lhs_id || (canUnfold (idOptUnfolding dflags lhs_id) + | isLocalId lhs_id || (canUnfold (idOptUnfolding dflags lhs_id)) -- If imported with no unfolding, no worries , idInlineActivation lhs_id `competesWith` rule_act = warnDs (Reason Opt_WarnInlineRuleShadowing) diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs index 9fce8aa9df..afb306d300 100644 --- a/compiler/iface/TcIface.hs +++ b/compiler/iface/TcIface.hs @@ -370,7 +370,7 @@ typecheckIfacesForMerging mod ifaces tc_env_var = -- See Note [Resolving never-exported Names in TcIface] type_env <- fixM $ \type_env -> do setImplicitEnvM type_env $ do - decls <- loadDecls ignore_prags (mi_decls iface) + decls <- loadDecls (mi_decls iface) return (mkNameEnv decls) -- But note that we use this type_env to typecheck references to DFun -- in 'IfaceInst' @@ -415,6 +415,7 @@ typecheckIfaceForInstantiate nsubst iface = setImplicitEnvM type_env $ do insts <- mapM tcIfaceInst (mi_insts iface) fam_insts <- mapM tcIfaceFamInst (mi_fam_insts iface) + rules <- tcIfaceRules (mi_rules iface) anns <- tcIfaceAnnotations (mi_anns iface) exports <- ifaceExportNames (mi_exports iface) complete_sigs <- tcIfaceCompleteSigs (mi_complete_sigs iface) @@ -619,7 +620,6 @@ tcIfaceDecl :: IfaceDecl tcIfaceDecl = tc_iface_decl Nothing tc_iface_decl :: Maybe Class -- ^ For associated type/data family declarations - -> Bool -- ^ True <=> discard IdInfo on IfaceId bindings -> IfaceDecl -> IfL TyThing tc_iface_decl _ (IfaceId {ifName = name, ifType = iface_type, @@ -715,7 +715,7 @@ tc_iface_decl _parent ; cls <- buildClass tc_name binders' roles fds Nothing ; return (ATyCon (classTyCon cls)) } -tc_iface_decl _parent ignore_prags +tc_iface_decl _parent (IfaceClass {ifName = tc_name, ifRoles = roles, ifBinders = binders, @@ -1431,7 +1431,7 @@ tcIdDetails ty IfDFunId tcIdDetails _ (IfRecSelId tc naughty) = do { tc' <- either (fmap RecSelData . tcIfaceTyCon) - (fmap (RecSelPatSyn . tyThingPatSyn) . tcIfaceDecl False) + (fmap (RecSelPatSyn . tyThingPatSyn) . tcIfaceDecl) tc ; return (RecSelId { sel_tycon = tc', sel_naughty = naughty }) } where diff --git a/compiler/iface/TcIface.hs-boot b/compiler/iface/TcIface.hs-boot index f1e7dd7d8c..ddf04554f5 100644 --- a/compiler/iface/TcIface.hs-boot +++ b/compiler/iface/TcIface.hs-boot @@ -1,6 +1,5 @@ module TcIface where -import GhcPrelude import IfaceSyn ( IfaceDecl, IfaceClsInst, IfaceFamInst, IfaceRule, IfaceAnnotation, IfaceCompleteMatch ) import TyCoRep ( TyThing ) |