Convert diagnostics in GHC.Rename.Expr to proper TcRnMessage (#20115)
I rewrote all usages of TcRnUnknownMessage in GHC.Rename.Expr
To do so, I introduced several new messages in the first step:
- TcRnNoRebindableSyntaxRecordDotError
- TcRnNoFieldPunsRecordDotError
- TcRnIllegalStaticExpressionError
- TcRnIllegalStaticFormInSlice
- TcRnListComprehensionDuplicateBinding
- TcRnEmptyStmtsGroupError
- TcRnLastStmtNotExprError
- TcRnUnexpectedStatementInContext
- TcRnIllegalTupleSection
- TcRnIllegalImplicitParameterBindings
- TcRnSectionWithoutParenthesesError
I also introduced a new GADT tag: HsExprOrCmd, because I have to know the proper body
type to avoid making TcRnMessage an existential.
In the second step, I simplified AnnoBody constraint and reduced its usage, because it can be replaced with HsExprOrCmd, which I mentioned above.