Special-case implicit params in superclass expansion
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 22 Jan 2016 16:34:18 +0000 (16:34 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Mon, 25 Jan 2016 11:32:25 +0000 (11:32 +0000)
commitff21795a0b9253e811a45626d5686e981ed07f82
tree62224ed16e322bd7fb13424d9331243decb96712
parentfd6dd41c67f3bd23bbf074357219cfd251eb53d6
Special-case implicit params in superclass expansion

This issue came up in Trac #11480, and is documented in
Note [When superclasses help] in TcRnTypes.

We were getting a spurious warning
  T11480.hs:1:1: warning:
     solveWanteds: too many iterations (limit = 4)

The fix is easy.  A bit of refactoring along the way.

The original bug report in Trac #11480 appears to work
fine in HEAD and the 8.0 branch but I added a regression
test in this commit as well.
compiler/typecheck/TcCanonical.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcSMonad.hs
compiler/typecheck/TcSimplify.hs
testsuite/tests/polykinds/T11480a.hs [new file with mode: 0644]
testsuite/tests/polykinds/all.T
testsuite/tests/typecheck/should_compile/T11480.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T