Fix kind-checking for data/newtypes
In one spot in kcConDecl we were passing in the return kind signature rether than the return kind. e.g. #16828 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.)
Showing
- compiler/typecheck/TcInstDcls.hs 19 additions, 15 deletionscompiler/typecheck/TcInstDcls.hs
- compiler/typecheck/TcTyClsDecls.hs 50 additions, 16 deletionscompiler/typecheck/TcTyClsDecls.hs
- testsuite/tests/indexed-types/should_compile/T16828.hs 13 additions, 0 deletionstestsuite/tests/indexed-types/should_compile/T16828.hs
- testsuite/tests/indexed-types/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/indexed-types/should_compile/all.T
Please register or sign in to comment