Check for overlap-flag differences in hi files
authorsimonpj@microsoft.com <unknown>
Fri, 14 Jul 2006 16:38:43 +0000 (16:38 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 14 Jul 2006 16:38:43 +0000 (16:38 +0000)
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
compiler/iface/MkIface.lhs
compiler/types/InstEnv.lhs

index 608e62a..2702181 100644 (file)
@@ -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)
index 1e85ac4..3ff30d9 100644 (file)
@@ -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 
index d4a7b77..70e6166 100644 (file)
@@ -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