Skip to content

Default kind variables in type families with -XNoPolyKinds

sheaf requested to merge sheaf/ghc:T20584 into master

We should still default kind variables in type families in the presence of -XNoPolyKinds, as otherwise kind variables introduced by e.g. the function arrow could cause the typechecker to ask the user to enable -XPolyKinds.

For example:

type F :: Type -> Type
type family F t where
  F (a -> b) = b

Here we get a :: TYPE r and with -XNoPolyKinds we should still default r. However, this only applies to kind variables; we should still be able to write:

type R :: RuntimeRep -> Type
type family R r where
  R _ = Int

with -XNoPolyKinds, and not have _ :: RuntimeRep be defaulted.

Fixes #20584 (closed).

Merge request reports