Prioritise equalities when solving, incl deriveds
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 31 Jan 2018 13:05:13 +0000 (13:05 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 31 Jan 2018 13:24:23 +0000 (13:24 +0000)
commitefba054640d3418d7477316ae0c1e992d0aa0f22
tree25d887fe807edc6c1f53b0d74dde92bfc7d4572f
parent0f43d0dba3da7b16f6d3fd2e7cb6e62ac524eb04
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.
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