Scoped kind variables in standalone kind signatures
Summary
StandaloneKindSignatures
and ScopedTypeVariables
currently do not interact, contrary to users' expectations. See e.g. #19498 (closed)
Term-level type signatures bring forall-bound type variables into scope in the definition. For consistency, standalone kind signatures should too. This change in behavior is the subject of the accepted proposal amendment #592 Scoped kind variables in standalone kind signatures.
Steps to reproduce
type T :: forall k. k -> Type
data T a = MkT (Proxy (a :: k))
This code fails with
Test.hs:5:29: error: [GHC-76037]
Not in scope: type variable ‘k’
|
5 | data T a = MkT (Proxy (a :: k))
|
Expected behavior
The example should compile and behave identically to
type T :: forall k. k -> Type
data T @k a = MkT (Proxy (a :: k))
Environment
- GHC version used: 9.10.1