Fix Trac #2412: type synonyms and hs-boot recursion
authorsimonpj@microsoft.com <unknown>
Mon, 11 Aug 2008 12:25:23 +0000 (12:25 +0000)
committersimonpj@microsoft.com <unknown>
Mon, 11 Aug 2008 12:25:23 +0000 (12:25 +0000)
commit1fa3580c54985d73178d1d396b897176a57cd7f3
tree5ce0fc6a6c02549637e7da7ecda706f06bda1dc3
parent96438b8912028d59873bdba4995838cc21cc804f
Fix Trac #2412: type synonyms and hs-boot recursion

Max Bolingbroke found this awkward bug, which relates to the way in
which hs-boot files are handled.

   --> HEADS UP: interface file format change: recompile everything!

When we import a type synonym, we want to *refrain* from looking at its
RHS until we've "tied the knot" in the module being compiled.  (Reason:
the type synonym might ultimately loop back to the module being compiled.)
To achieve this goal we need to know the *kind* of the synonym without
looking at its RHS.  And to do that we need its kind recorded in the interface
file.

I slightly refactored the way that the IfaceSyn data constructor
fields work, eliminating the previous tricky re-use of the same field
as either a type or a kind.

See Note [Synonym kind loop] in TcIface
compiler/iface/BuildTyCl.lhs
compiler/iface/IfaceSyn.lhs
compiler/iface/MkIface.lhs
compiler/iface/TcIface.lhs
compiler/typecheck/TcEnv.lhs
compiler/typecheck/TcRnDriver.lhs
compiler/typecheck/TcTyClsDecls.lhs
compiler/vectorise/VectType.hs