Apply the right substitution in ty-fam improvement
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 20 Jan 2017 23:47:28 +0000 (23:47 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Mon, 23 Jan 2017 08:28:26 +0000 (08:28 +0000)
commit2b64e926a628fb2a3710b0360123ea73331166fe
treef4c821588ec0653e150e8870544f9077dcfe20ee
parent6850eb64cc2312e53740edbd94ed2abd7d06f41e
Apply the right substitution in ty-fam improvement

Trac #13135 showed that we were failing to apply the
correct substitution to the un-substituted tyvars during
type-family improvement using injectivity.  Specifically
in TcInteractlinjImproveEqns we need to use instFlexiX.

An outright bug, easy to fix.

Slight refactoring along the way.  The quantified tyars of the axiom are
readily to hand; we don't need to take the free tyvars of the LHS
compiler/typecheck/TcInteract.hs
compiler/typecheck/TcSMonad.hs
testsuite/tests/dependent/should_fail/T13135.hs [new file with mode: 0644]
testsuite/tests/dependent/should_fail/T13135.stderr [new file with mode: 0644]
testsuite/tests/dependent/should_fail/all.T