Use a well-kinded substitution to instantiate
authorSimon Peyton Jones <simonpj@microsoft.com>
Mon, 28 Aug 2017 16:21:14 +0000 (17:21 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Tue, 29 Aug 2017 08:37:07 +0000 (09:37 +0100)
commit4455c86d1635bfb846e750b21dda36dcee028b5e
tree03e561e424d1c2e664c69ef552497268b65e2a2a
parent86e6a5f232c6ac4a1cf54130a9987b2b89ace786
Use a well-kinded substitution to instantiate

In tcDataConPat we were creating an ill-kinded substitution
-- or at least one that is well kinded only after you have solved
other equalities.  THat led to a crash, because the instantiated
data con type was ill-kinded.

This patch guarantees that the instantiating substitution is
well-kinded.

Fixed Trac #14154
compiler/typecheck/Inst.hs
compiler/typecheck/TcPat.hs
testsuite/tests/typecheck/should_compile/T14154.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T