Various fixes to type-tidying
This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type)
Showing
- compiler/GHC/Core/TyCo/FVs.hs 3 additions, 0 deletionscompiler/GHC/Core/TyCo/FVs.hs
- compiler/GHC/Core/TyCo/Ppr.hs 11 additions, 7 deletionscompiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/TyCo/Tidy.hs 169 additions, 60 deletionscompiler/GHC/Core/TyCo/Tidy.hs
- compiler/GHC/Core/Type.hs 4 additions, 2 deletionscompiler/GHC/Core/Type.hs
- compiler/GHC/Iface/Tidy/StaticPtrTable.hs 2 additions, 0 deletionscompiler/GHC/Iface/Tidy/StaticPtrTable.hs
- compiler/GHC/Rename/Names.hs 1 addition, 1 deletioncompiler/GHC/Rename/Names.hs
- compiler/GHC/Runtime/Debugger.hs 1 addition, 1 deletioncompiler/GHC/Runtime/Debugger.hs
- compiler/GHC/Runtime/Eval.hs 2 additions, 2 deletionscompiler/GHC/Runtime/Eval.hs
- compiler/GHC/Tc/Errors.hs 7 additions, 1 deletioncompiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs 1 addition, 1 deletioncompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/Bind.hs 2 additions, 2 deletionscompiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Expr.hs 3 additions, 1 deletioncompiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Solver/Monad.hs 1 addition, 2 deletionscompiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Types/Constraint.hs 15 additions, 0 deletionscompiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Utils/TcMType.hs 4 additions, 5 deletionscompiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Validity.hs 4 additions, 2 deletionscompiler/GHC/Tc/Validity.hs
- compiler/GHC/Tc/Zonk/TcType.hs 5 additions, 6 deletionscompiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/Types/Name/Occurrence.hs 23 additions, 5 deletionscompiler/GHC/Types/Name/Occurrence.hs
- compiler/GHC/Types/Var/Env.hs 1 addition, 1 deletioncompiler/GHC/Types/Var/Env.hs
- testsuite/tests/dependent/should_compile/T15743e.stderr 1 addition, 1 deletiontestsuite/tests/dependent/should_compile/T15743e.stderr
Loading
Please register or sign in to comment