Prioritise equalities when solving, incl deriveds
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 31 Jan 2018 13:05:13 +0000 (13:05 +0000)
committerBen Gamari <ben@smart-cactus.org>
Thu, 1 Feb 2018 03:12:46 +0000 (22:12 -0500)
commit77cdf60c8a68d2208cd8109d82b5f83b17bf0e91
treed930a6139531808c2796bda898feda3dc7c4958a
parente6c147442fbeb161bbed209126186056f371d60c
Prioritise equalities when solving, incl deriveds

We already prioritise equalities when solving, but
Trac #14723 showed that we were not doing so consistently
enough, and as a result the type checker could go into a loop.
Yikes.

See Note [Prioritise equalities] in TcSMonad.

Fixng this bug changed the solve order enough to demonstrate
a problem with fundeps: Trac #14745.

(cherry picked from commit efba054640d3418d7477316ae0c1e992d0aa0f22)
compiler/typecheck/TcSMonad.hs
testsuite/tests/polykinds/T14723.hs [new file with mode: 0644]
testsuite/tests/polykinds/all.T
testsuite/tests/typecheck/should_compile/T13651.hs
testsuite/tests/typecheck/should_compile/T13651.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T13651a.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T