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.
Showing
- compiler/GHC/Hs/Type.hs 8 additions, 1 deletioncompiler/GHC/Hs/Type.hs
- compiler/GHC/Rename/HsType.hs 16 additions, 3 deletionscompiler/GHC/Rename/HsType.hs
- compiler/GHC/Tc/Errors/Ppr.hs 1 addition, 0 deletionscompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs 3 additions, 0 deletionscompiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Errors/Types/PromotionErr.hs 48 additions, 1 deletioncompiler/GHC/Tc/Errors/Types/PromotionErr.hs
- compiler/GHC/Tc/Gen/HsType.hs 2 additions, 1 deletioncompiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Types/BasicTypes.hs 1 addition, 1 deletioncompiler/GHC/Tc/Types/BasicTypes.hs
- compiler/GHC/Tc/Utils/Env.hs 7 additions, 1 deletioncompiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Types/Error/Codes.hs 13 additions, 1 deletioncompiler/GHC/Types/Error/Codes.hs
- testsuite/tests/dependent/should_fail/PromotedClass.stderr 1 addition, 1 deletiontestsuite/tests/dependent/should_fail/PromotedClass.stderr
- testsuite/tests/dependent/should_fail/SelfDep.stderr 1 addition, 1 deletiontestsuite/tests/dependent/should_fail/SelfDep.stderr
- testsuite/tests/dependent/should_fail/T13780a.stderr 1 addition, 1 deletiontestsuite/tests/dependent/should_fail/T13780a.stderr
- testsuite/tests/dependent/should_fail/T13780c.stderr 2 additions, 2 deletionstestsuite/tests/dependent/should_fail/T13780c.stderr
- testsuite/tests/dependent/should_fail/T14845_compile.stderr 1 addition, 1 deletiontestsuite/tests/dependent/should_fail/T14845_compile.stderr
- testsuite/tests/dependent/should_fail/T14845_fail1.stderr 1 addition, 1 deletiontestsuite/tests/dependent/should_fail/T14845_fail1.stderr
- testsuite/tests/dependent/should_fail/T14845_fail2.stderr 1 addition, 1 deletiontestsuite/tests/dependent/should_fail/T14845_fail2.stderr
- testsuite/tests/dependent/should_fail/T15215.stderr 1 addition, 1 deletiontestsuite/tests/dependent/should_fail/T15215.stderr
- testsuite/tests/dependent/should_fail/T15245.stderr 1 addition, 1 deletiontestsuite/tests/dependent/should_fail/T15245.stderr
- testsuite/tests/patsyn/should_fail/T11265.stderr 1 addition, 1 deletiontestsuite/tests/patsyn/should_fail/T11265.stderr
- testsuite/tests/patsyn/should_fail/T9161-1.stderr 1 addition, 1 deletiontestsuite/tests/patsyn/should_fail/T9161-1.stderr
Loading
Please register or sign in to comment