Fix egregious instantiation bug in matchOneConLike (fixing Trac #9023)
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 5 Jun 2014 10:03:45 +0000 (11:03 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 5 Jun 2014 10:04:06 +0000 (11:04 +0100)
commit0a55a3cada2fea37586b1a270c1511ed9957dbd4
treed8f86404363411084ffe1158deccfd361811b5b0
parentc63a465011b99eeafbb957074e54c2e6bbf751d9
Fix egregious instantiation bug in matchOneConLike (fixing Trac #9023)

We simply weren't giving anything like the right instantiating types
to patSynInstArgTys in matchOneConLike.

To get these instantiating types would have involved matching the
result type of the pattern synonym with the pattern type, which is
tiresome.  So instead I changed ConPatOut so that instead of recording
the type of the *whole* pattern (in old field pat_ty), it not records
the *instantiating* types (in new field pat_arg_tys).  Then we canuse
TcHsSyn.conLikeResTy to get the pattern type when needed.

There are lots of knock-on incidental effects, but they mostly made
the code simpler, so I'm happy.
14 files changed:
compiler/basicTypes/PatSyn.lhs
compiler/deSugar/Check.lhs
compiler/deSugar/DsExpr.lhs
compiler/deSugar/DsUtils.lhs
compiler/deSugar/Match.lhs
compiler/deSugar/MatchCon.lhs
compiler/deSugar/MatchLit.lhs
compiler/hsSyn/Convert.lhs
compiler/hsSyn/HsPat.lhs
compiler/hsSyn/HsUtils.lhs
compiler/parser/RdrHsSyn.lhs
compiler/rename/RnPat.lhs
compiler/typecheck/TcHsSyn.lhs
compiler/typecheck/TcPat.lhs