Put kind variables before type variables when specializing
authorBartosz Nitka <niteria@gmail.com>
Wed, 11 Nov 2015 11:31:55 +0000 (12:31 +0100)
committerBen Gamari <ben@smart-cactus.org>
Wed, 11 Nov 2015 11:32:05 +0000 (12:32 +0100)
commit0f49508399a1fc145e17950ea1591da7f0de4f2a
tree60cacb1e916a4f6591e2fbac6e0fca91407b1b96
parentfa61eddebf6f3ad5671c81f8bf0494e81332c4ec
Put kind variables before type variables when specializing

When you reverse the order of uniques you get the core lint
error from the testcase. The testcase is copied from
tests/simplCore/should_compile/T10689a.hs.

The problem is that we would put type and kind variables ordered by
unique order, which happened to be the right order for this testcase to
pass under normal conditions.

I think it's enough to sort them with `sortQuantVars`, but I'm not
really sure if some more sophisticated dependency analysis isn't needed.

Test Plan: added a new testcase

Reviewers: simonpj, goldfire, simonmar, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1457
compiler/specialise/SpecConstr.hs
testsuite/tests/determinism/should_compile/Makefile [new file with mode: 0644]
testsuite/tests/determinism/should_compile/all.T [new file with mode: 0644]
testsuite/tests/determinism/should_compile/determ004.hs [new file with mode: 0644]