Kind-check CUSK associated types separately
authorRichard Eisenberg <rae@cs.brynmawr.edu>
Thu, 5 Jul 2018 19:09:50 +0000 (15:09 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 12 Jul 2018 21:06:12 +0000 (17:06 -0400)
commitd0dfc5cc4859a07778bc674eb865811616d4d6c6
tree581178e3a7f2d3da0faa4bff72620a7154ac4de7
parentcfc4afad16d0eb99d5576cd998bcf473a1bc2af5
Kind-check CUSK associated types separately

Previously, we kind-checked associated types while while still
figuring out the kind of a CUSK class. This caused trouble, as
documented in Note [Don't process associated types in kcLHsQTyVars]
in TcTyClsDecls. This commit moves this process after the initial
kind of the class is determined.

Fixes #15142.

Test case: indexed-types/should_compile/T15142.hs

(cherry picked from commit 030211d21207dabb7a4bf21cc9af6fa5eb066db1)
compiler/typecheck/TcHsType.hs
compiler/typecheck/TcTyClsDecls.hs
testsuite/tests/indexed-types/should_compile/T15142.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/all.T