Prioritise class-level equality costraints
authorSimon Peyton Jones <simonpj@microsoft.com>
Mon, 24 Oct 2016 15:55:49 +0000 (16:55 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Mon, 24 Oct 2016 15:55:49 +0000 (16:55 +0100)
commit1c4a39d3a8d36803382792ff78b4709794358883
treef8b34b1a92f8ef6bddd5590c1f8f7b757e23631d
parentf084e6845515fbfb774a09ae5d2af1eea8fdc3f0
Prioritise class-level equality costraints

This patch fixes Trac #12734 by prioritising the class-level
variants of equality constraints, namely (a~b) and (a~~b).

See comment:10 of Trac #12734 for a description of what
went wrong, and Note [Prioritise class equalities] in TcSMonad.

The fix is still not great, but it's a definite step forward, and
cures the particular problem.

Worth merging to 8.0.
compiler/typecheck/TcSMonad.hs
testsuite/tests/typecheck/should_compile/T12734.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T12734a.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T12734a.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T