canCFunEqCan: use isTcReflexiveCo (not isTcReflCo)
authorSimon Peyton Jones <simonpj@microsoft.com>
Mon, 3 Sep 2018 08:00:49 +0000 (09:00 +0100)
committerBen Gamari <ben@smart-cactus.org>
Sun, 16 Sep 2018 16:31:17 +0000 (12:31 -0400)
commit83ca9bb257ff9e0b9ebfa37ba1449118d15543a2
treeda4a47878690b37610a13f48ccae100f2b80093e
parent8344588e23fc9bb3c1b15e81edd316134c9860ec
canCFunEqCan: use isTcReflexiveCo (not isTcReflCo)

As Trac #15577 showed, it was possible for a /homo-kinded/
constraint to trigger the /hetero-kinded/ branch of canCFunEqCan,
and that triggered an infinite loop.

The fix is easier, but there remains a deeper questions: why is
the flattener producing giant refexive coercions?

(cherry picked from commit 2e226a46c422c12f78dc3d3f62fe5a15e22bd986)
compiler/typecheck/TcCanonical.hs
testsuite/tests/polykinds/T15577.hs [new file with mode: 0644]
testsuite/tests/polykinds/T15577.stderr [new file with mode: 0644]
testsuite/tests/polykinds/all.T