Skip to content

Fix kind-checking for data/newtypes (#16828)

Simon Peyton Jones requested to merge wip/T16828 into master

In one spot in kcConDecl we were passing in the return kind signature rether than the return kind. e.g. #16828 (closed)

   newtype instance Foo :: Type -> Type where
     MkFoo :: a -> Foo a

We were giving kcConDecl the kind (Type -> Type), whereas it was expecting the ultimate return kind, namely Type.

This "looking past arrows" was being done, independently, in several places, but we'd missed one. This patch moves it all to one place -- the new function kcConDecls (note the plural).

I also took the opportunity to rename tcDataFamHeader to tcDataFamInstHeader

(The previous name was consistently a source of confusion.)

Merge request reports