[commit: ghc] master: Account for IfUnpackCo in freeNamesIfDecl (8fe37a0)
git at git.haskell.org
git at git.haskell.org
Fri May 19 11:24:15 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/8fe37a0222517c3af5ffbb793fa738ad7f3eac3d/ghc
>---------------------------------------------------------------
commit 8fe37a0222517c3af5ffbb793fa738ad7f3eac3d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri May 19 12:00:26 2017 +0100
Account for IfUnpackCo in freeNamesIfDecl
We were simply failing to recognise all the free variables of an
IfaceDecl, notably the ones in the coercion of an IfUnpackCo.
Result: the dependency analysis got messed up, so that fingerprint
calculation went wrong. Trac #13695 showed it up.
A test case is tricky but the fix is a solid one.
>---------------------------------------------------------------
8fe37a0222517c3af5ffbb793fa738ad7f3eac3d
compiler/iface/IfaceSyn.hs | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/compiler/iface/IfaceSyn.hs b/compiler/iface/IfaceSyn.hs
index d5ca24e..338397d 100644
--- a/compiler/iface/IfaceSyn.hs
+++ b/compiler/iface/IfaceSyn.hs
@@ -1372,12 +1372,18 @@ freeNamesIfConDecl :: IfaceConDecl -> NameSet
freeNamesIfConDecl (IfCon { ifConExTvs = ex_tvs, ifConCtxt = ctxt
, ifConArgTys = arg_tys
, ifConFields = flds
- , ifConEqSpec = eq_spec })
+ , ifConEqSpec = eq_spec
+ , ifConStricts = bangs })
= freeNamesIfTyVarBndrs ex_tvs &&&
freeNamesIfContext ctxt &&&
fnList freeNamesIfType arg_tys &&&
mkNameSet (map flSelector flds) &&&
- fnList freeNamesIfType (map snd eq_spec) -- equality constraints
+ fnList freeNamesIfType (map snd eq_spec) &&& -- equality constraints
+ fnList freeNamesIfBang bangs
+
+freeNamesIfBang :: IfaceBang -> NameSet
+freeNamesIfBang (IfUnpackCo co) = freeNamesIfCoercion co
+freeNamesIfBang _ = emptyNameSet
freeNamesIfKind :: IfaceType -> NameSet
freeNamesIfKind = freeNamesIfType
More information about the ghc-commits
mailing list