Make tcg_dus behave more sanely; fixes a mkUsageInfo panic
authorsimonpj@microsoft.com <unknown>
Thu, 6 May 2010 16:27:19 +0000 (16:27 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 6 May 2010 16:27:19 +0000 (16:27 +0000)
commitb2d9ef8482638a91e68acdd19ecfe24db0458049
tree868ab3d4bef41859e08c0b3897429c8be4ca0bc2
parent302e2e29f2e1074bfba561e077a484dc4e1d15f6
Make tcg_dus behave more sanely; fixes a mkUsageInfo panic

The tcg_dus field used to contain *uses* of type and class decls,
but not *defs*.  That was inconsistent, and it really went wrong
for Template Haskell bracket.  What happened was that
 foo = [d| data A = A
           f :: A -> A
           f x = x |]
would find a "use" of A when processing the top level of the module,
which in turn led to a mkUsageInfo panic in MkIface.  The cause was
the fact that the tcg_dus for the nested quote didn't have defs for
A.
compiler/basicTypes/NameSet.lhs
compiler/rename/RnBinds.lhs
compiler/rename/RnExpr.lhs
compiler/rename/RnSource.lhs