From 872a4a0fd2a99ea96bee36f5398e87002659e014 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Fri, 14 Jul 2006 16:38:43 +0000 Subject: [PATCH] Check for overlap-flag differences in hi files MERGE TO STABLE I'd forgotten to compare the per-instance overlap flag when comparing interface files, and that meant that consequential recompilations weren't being triggered when the only change was to add -fallow-overlapping-instances Fixes Trac bug #824 --- compiler/iface/IfaceSyn.lhs | 2 +- compiler/iface/MkIface.lhs | 4 +++- compiler/types/InstEnv.lhs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index 608e62a..2702181 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -800,7 +800,7 @@ eqWith :: [IfaceTvBndr] -> [IfaceTvBndr] -> (EqEnv -> IfaceEq) -> IfaceEq eqWith = eq_ifTvBndrs emptyEqEnv ----------------------- -eqIfInst d1 d2 = bool (ifDFun d1 == ifDFun d2) +eqIfInst d1 d2 = bool (ifDFun d1 == ifDFun d2 && ifOFlag d1 == ifOFlag d2) -- All other changes are handled via the version info on the dfun eqIfRule (IfaceRule n1 a1 bs1 f1 es1 rhs1 o1) diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs index 1e85ac4..3ff30d9 100644 --- a/compiler/iface/MkIface.lhs +++ b/compiler/iface/MkIface.lhs @@ -482,7 +482,9 @@ addVersionInfo (Just old_iface@(ModIface { mi_mod_vers = old_mod_vers, ------------------- -- Adding version info - new_version = bumpVersion old_mod_vers + new_version = bumpVersion old_mod_vers -- Start from the old module version, not from zero + -- so that if you remove f, and then add it again, + -- you don't thereby reduce f's version number add_vers decl | occ `elemOccSet` changed_occs = new_version | otherwise = expectJust "add_vers" (old_decl_vers occ) -- If it's unchanged, there jolly well diff --git a/compiler/types/InstEnv.lhs b/compiler/types/InstEnv.lhs index d4a7b77..70e6166 100644 --- a/compiler/types/InstEnv.lhs +++ b/compiler/types/InstEnv.lhs @@ -108,7 +108,7 @@ data Instance -- This is used for versioning; the instance decl is -- considered part of the defn of n when computing versions -- --- Nothing The head mentions nothing defined in this modle +-- Nothing The head mentions nothing defined in this module -- -- If a module contains any orphans, then its interface file is read -- regardless, so that its instances are not missed. @@ -240,6 +240,7 @@ data OverlapFlag -- Without the Incoherent flag, we'd complain that -- instantiating 'b' would change which instance -- was chosen + deriving( Eq ) instance Outputable OverlapFlag where ppr NoOverlap = empty -- 1.7.10.4