[Git][ghc/ghc][master] Report scoped kind variables at the type-checking phase (#16635)

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Jun 15 22:08:47 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
78cd1132 by Andrei Borzenkov at 2023-06-15T11:16:11+04:00
Report scoped kind variables at the type-checking phase (#16635)

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.

- - - - -


30 changed files:

- compiler/GHC/Hs/Type.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Errors/Types/PromotionErr.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Types/BasicTypes.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Types/Error/Codes.hs
- testsuite/tests/dependent/should_fail/PromotedClass.stderr
- testsuite/tests/dependent/should_fail/SelfDep.stderr
- testsuite/tests/dependent/should_fail/T13780a.stderr
- testsuite/tests/dependent/should_fail/T13780c.stderr
- testsuite/tests/dependent/should_fail/T14845_compile.stderr
- testsuite/tests/dependent/should_fail/T14845_fail1.stderr
- testsuite/tests/dependent/should_fail/T14845_fail2.stderr
- testsuite/tests/dependent/should_fail/T15215.stderr
- testsuite/tests/dependent/should_fail/T15245.stderr
- testsuite/tests/patsyn/should_fail/T11265.stderr
- testsuite/tests/patsyn/should_fail/T9161-1.stderr
- testsuite/tests/patsyn/should_fail/T9161-2.stderr
- testsuite/tests/polykinds/PolyKinds06.stderr
- testsuite/tests/polykinds/PolyKinds07.stderr
- testsuite/tests/polykinds/T13625.stderr
- testsuite/tests/polykinds/T15116.stderr
- testsuite/tests/polykinds/T15116a.stderr
- testsuite/tests/polykinds/T5716.stderr
- testsuite/tests/polykinds/T5716a.stderr
- testsuite/tests/polykinds/T6129.stderr
- testsuite/tests/polykinds/T7433.stderr


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/78cd11329ce2ed00cbba8a459fe688ccc8f83d13

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/78cd11329ce2ed00cbba8a459fe688ccc8f83d13
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230615/ada48ad3/attachment-0001.html>


More information about the ghc-commits mailing list