Fix Trac #4953: local let binders can have IdInfo with free names
authorsimonpj@microsoft.com <unknown>
Mon, 14 Feb 2011 14:03:34 +0000 (14:03 +0000)
committersimonpj@microsoft.com <unknown>
Mon, 14 Feb 2011 14:03:34 +0000 (14:03 +0000)
Local let binders in IfaceExpr never used to have unfoldings,
but lately they can (becuase they can have an INLINE pragma).
We must take account of the variables mentioned in the pragma
when computing the fingerprint.

compiler/iface/IfaceSyn.lhs

index c06137c..3eae7a3 100644 (file)
@@ -798,8 +798,10 @@ freeNamesIfBndr (IfaceTvBndr b) = freeNamesIfTvBndr b
 
 freeNamesIfLetBndr :: IfaceLetBndr -> NameSet
 -- Remember IfaceLetBndr is used only for *nested* bindings
--- The cut-down IdInfo never contains any Names, but the type may!
-freeNamesIfLetBndr (IfLetBndr _name ty _info) = freeNamesIfType ty
+-- The IdInfo can contain an unfolding (in the case of 
+-- local INLINE pragmas), so look there too
+freeNamesIfLetBndr (IfLetBndr _name ty info) = freeNamesIfType ty
+                                             &&& freeNamesIfIdInfo info
 
 freeNamesIfTvBndr :: IfaceTvBndr -> NameSet
 freeNamesIfTvBndr (_fs,k) = freeNamesIfType k