Skip to content

Finish migration of diagnostics in GHC.Tc.Validity

sheaf requested to merge sheaf/ghc:tcrnunknown into master

This patch finishes migrating the error messages in GHC.Tc.Validity to use the new diagnostic infrastructure.

It also refactors the error message datatypes for class and family instances, to common them up under a single datatype as much as possible.

TODO:

  • Migrate the call of mkTcRnUnknownMessage in checkTyConTelescope.
  • Migrate the call of mkTcRnUnknownMessage in checkValidTypePats.
  • Migrate the call of mkTcRnUnknownMessage in solverDepthError.
  • Combine some constructors of IllegalInstanceHead: InstHeadMalformed, InstHeadNonClass, InstHeadNonClass2. Mark the corresponding diagnostic codes as unused after doing so.
  • Tidy up the error message printing to avoid duplicating pieces of information, such as duplicating the header "Illegal instance declaration for...".
  • Add test cases & examples in the documentation of TcRnSolverDepthError and TcRnBadTyConTelescope.
Edited by sheaf

Merge request reports