Fix constraint solving for forall-types
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 28 Jun 2017 11:38:59 +0000 (12:38 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 28 Jun 2017 11:38:59 +0000 (12:38 +0100)
commitfae672f647fe00c303d8fb56971563c1a76ad04e
tree5a1a8f38e6be315962ff9e6166a6314fd88f9da9
parentc80920d26f4eef8e87c130412d007628cff7589d
Fix constraint solving for forall-types

Trac #13879 showed that when we were trying to solve

  (forall z1 (y1::z1). ty1)  ~  (forall z2 (y2:z2). ty2)

we'd end up spitting out z1~z2 with no binding site for them.
Those kind equalities need to be inside the implication.

I ended up re-factoring the code for solving forall-equalities.
It's quite nice now.
compiler/typecheck/TcCanonical.hs
compiler/typecheck/TcSMonad.hs
testsuite/tests/typecheck/should_compile/T13879.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T
testsuite/tests/typecheck/should_fail/tcfail174.stderr