Only skip decls with CUSKs in kcLTyClDecl with PolyKinds on
Data type kind checking skips decls with CUSKs in
kcLTyClDecl (see note [Skip decls with CUSKs in kcLTyClDecl] in
However, when we have no PolyKinds, we shouldn't skip the check, because we have defaulting. Skipping won't bring us more polymorphism when we have defaulting.
WITHOUT any language extension, the following program is rejected nowadays.
data T1 a = MkT1 T2 data T2 = MkT2 (T1 Maybe)
T2 are in the same recursive group. Since
T2 has a CUSK (which is
(T1 Maybe) is skipped when kind-checking. So the kind of
a remains unsolved and is thus defaulted to
(T1 Maybe) fails to type-check because of a kind mismatch between
Type -> Type.
The program type-checks in GHC 8.4 but fails to type-check since GHC 8.6.
Propose: when we have NoPolyKinds, we don't skip the check; when we have PolyKinds, we skip the check.
Steps to reproduce
Type-check the example program.
The program should type-check.
- GHC version used: since 8.6