Fix Trac #2494: tcSimplifyRuleLhs
authorsimonpj@microsoft.com <unknown>
Mon, 11 Aug 2008 10:44:38 +0000 (10:44 +0000)
committersimonpj@microsoft.com <unknown>
Mon, 11 Aug 2008 10:44:38 +0000 (10:44 +0000)
commit4016ee2f11eaaa0a3f9f5f04aebd84d4c8f68ce4
tree182109eb60fa7942bcc4b7247a56cd9eb0efb5c8
parent7539ed8cade66d09fae1e0ccc66c519cafa3b55b
Fix Trac #2494: tcSimplifyRuleLhs

tcSimplifyRuleLhs is a cut-down constraint simplifier, intended for
use in RULE left-hand-sides.  But it was written before implication
constraints, and the exmaple of this bug report shows that when higher
rank types are involved we need to be a bit cleverer.

The whole business of simplifying constraints on rule LHSs is a bit
of a hack; but for a good reason.  See the comments with tcSimplifyRuleLhs.
This patch at least cures the crash.
compiler/typecheck/TcSimplify.lhs