Make applicative do work via expansions
Fixes #24406 Added Tests: T24406
The Applicative statements previously went via GHC.Tc.Gen.tcStmt
which calls tcSyntaxOp
.
This MR expands the Applicative statement similar to Monadic statements.
This MR does not work on rearranging the do statements.
Change noted in Note [Expanding HsDo with XXExprGhcRn]
This commit introduces a field xrn_doTcApp :: Bool
in ExpandedThingRn
(which we are not very happy about).
Setting it to True
typechecks the enclosing XExpr
expression with tcApp
setting it to False
typechecks it using tcExpr
. The reason to do it is to get good error messages.
Edited by Apoorv Ingle