Finish migration of diagnostics in GHC.Tc.Validity
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
incheckTyConTelescope
. -
Migrate the call of mkTcRnUnknownMessage
incheckValidTypePats
. -
Migrate the call of mkTcRnUnknownMessage
insolverDepthError
. -
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
andTcRnBadTyConTelescope
.