[Git][ghc/ghc][wip/T18126] Improve kind generalisation, error messages

Simon Peyton Jones gitlab at gitlab.haskell.org
Tue Aug 11 15:22:16 UTC 2020



Simon Peyton Jones pushed to branch wip/T18126 at Glasgow Haskell Compiler / GHC


Commits:
710aad27 by Simon Peyton Jones at 2020-08-11T16:21:54+01:00
Improve kind generalisation, error messages

This patch does two things:

* It refactors GHC.Tc.Errors a bit.  In debugging Quick Look I was
  forced to look in detail at error messages, and ended up doing a bit
  of refactoring, esp in mkTyVarEqErr'.  It's still quite a mess, but
  a bit better, I think.

* It makes a significant improvement to the kind checking of type and
  class declarations. Specifically, we now ensure that if kind
  checking fails with an unsolved constraint, all the skolems are in
  scope.  That wasn't the case before, which led to some obscure error
  messages; and occasional failures with "no skolem info" (eg #16245).

Both of these, and the main Quick Look patch itself, affect a /lot/ of
error messages, as you can see from the number of files changed.  I've
checked them all; I think they are as good or better than before.

Smaller things

* I documented the various instances of VarBndr better.
  See Note [The VarBndr tyep and its uses] in GHC.Types.Var

* Renamed GHC.Tc.Solver.simpl_top to simplifyTopWanteds

* A bit of refactoring in bindExplicitTKTele, to avoid the
  footwork with Either.  Simpler now.

* Move promoteTyVar from GHC.Tc.Solver to GHC.Tc.Utils.TcMType

Fixes #16245 (comment 211369), memorialised as
  typeecheck/polykinds/T16245a

- - - - -


30 changed files:

- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Types/Var.hs
- docs/users_guide/9.0.1-notes.rst
- docs/users_guide/exts/explicit_forall.rst
- docs/users_guide/exts/instances.rst
- docs/users_guide/ghci.rst
- testsuite/tests/dependent/should_fail/T13780a.stderr
- testsuite/tests/dependent/should_fail/T14066e.stderr
- testsuite/tests/dependent/should_fail/T15859.hs
- testsuite/tests/dependent/should_fail/T15859.stderr
- + testsuite/tests/dependent/should_fail/T15859a.hs
- + testsuite/tests/dependent/should_fail/T15859a.stderr
- testsuite/tests/dependent/should_fail/T16344a.stderr
- testsuite/tests/dependent/should_fail/all.T
- testsuite/tests/gadt/T12468.stderr
- testsuite/tests/gadt/gadt-escape1.stderr
- testsuite/tests/gadt/gadt13.stderr
- testsuite/tests/gadt/gadt7.stderr


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/710aad27519856b30a60f69bbf2910298e650166

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/710aad27519856b30a60f69bbf2910298e650166
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/20200811/f0500c0b/attachment.html>


More information about the ghc-commits mailing list