Skip to content
  • Andrei Borzenkov's avatar
    78cd1132
    Report scoped kind variables at the type-checking phase (#16635) · 78cd1132
    Andrei Borzenkov authored
    This patch modifies the renamer to respect ScopedTypeVariables in kind
    signatures. This means that kind variables bound by the outermost
    `forall` now scope over the type:
    
      type F = '[Right @a @() () :: forall a. Either a ()]
      --         ^^^^^^^^^^^^^^^          ^^^
      --          in scope here        bound here
    
    However, any use of such variables is a type error, because we don't
    have type-level lambdas to bind them in Core. This is described in the
    new Note [Type variable scoping errors during type check] in GHC.Tc.Types.
    78cd1132
    Report scoped kind variables at the type-checking phase (#16635)
    Andrei Borzenkov authored
    This patch modifies the renamer to respect ScopedTypeVariables in kind
    signatures. This means that kind variables bound by the outermost
    `forall` now scope over the type:
    
      type F = '[Right @a @() () :: forall a. Either a ()]
      --         ^^^^^^^^^^^^^^^          ^^^
      --          in scope here        bound here
    
    However, any use of such variables is a type error, because we don't
    have type-level lambdas to bind them in Core. This is described in the
    new Note [Type variable scoping errors during type check] in GHC.Tc.Types.
Loading