Keep track of explicit kinding in HsTyVarBndr; plus fix Trac #3845
authorsimonpj@microsoft.com <unknown>
Wed, 10 Feb 2010 14:51:55 +0000 (14:51 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 10 Feb 2010 14:51:55 +0000 (14:51 +0000)
commit836b1e90821aacc9d1e09fe78085f911597274c8
tree257a6707e12ab98412b253d2085652a1ef55c695
parentd8453ba7a64dbc41dc8784078895170746b455a9
Keep track of explicit kinding in HsTyVarBndr; plus fix Trac #3845

To print HsTypes correctly we should remember whether the Kind on
a HsTyVarBndr came from type inference, or was put there by the
user.  See Note [Printing KindedTyVars] in HsTypes.  So instead of
changing a UserTyVar to a KindedTyVar during kind checking, we
simply add a PostTcKind to the UserTyVar.

The change was provoked by Trac #3830, although other changes
mean that #3830 gets a diferent and better error message now.
So this patch is simply doing the Right Thing for the future.

This patch also fixes Trac #3845, which was caused by a *type splice*
not remembering the free *term variables* mentioned in it.  Result
was that we build a 'let' when it should have been 'letrec'.
Hence a new FreeVars field in HsSpliceTy.

While I was at it, I got rid of HsSpliceTyOut and use a PostTcKind
on HsSpliceTy instead, just like on the UserTyVar.
16 files changed:
compiler/deSugar/DsMeta.hs
compiler/hsSyn/Convert.lhs
compiler/hsSyn/HsDecls.lhs
compiler/hsSyn/HsTypes.lhs
compiler/hsSyn/HsUtils.lhs
compiler/parser/Parser.y.pp
compiler/parser/RdrHsSyn.lhs
compiler/rename/RnHsSyn.lhs
compiler/rename/RnTypes.lhs
compiler/typecheck/TcClassDcl.lhs
compiler/typecheck/TcEnv.lhs
compiler/typecheck/TcGenDeriv.lhs
compiler/typecheck/TcHsType.lhs
compiler/typecheck/TcSplice.lhs
compiler/typecheck/TcSplice.lhs-boot
compiler/typecheck/TcTyClsDecls.lhs