[Git][ghc/ghc][wip/ani/tc-expand] accept test case
Apoorv Ingle pushed to branch wip/ani/tc-expand at Glasgow Haskell Compiler / GHC Commits: 7ef903c6 by Apoorv Ingle at 2026-03-16T16:03:06-05:00 accept test case - - - - - 3 changed files: - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - testsuite/tests/ghci/prog-mhu001/prog-mhu001c.stdout Changes: ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -113,7 +113,7 @@ expand_do_stmts doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) | otherwise = pprPanic "expand_do_stmts: The impossible happened, missing bind operator from renamer" (text "stmt" <+> ppr stmt) -expand_do_stmts doFlavour (stmt@(L loc (BodyStmt _ (L e_lspan e) (SyntaxExprRn then_op) _)) : lstmts) = +expand_do_stmts doFlavour (stmt@(L loc (BodyStmt _ (L _ e) (SyntaxExprRn then_op) _)) : lstmts) = -- See Note [BodyStmt] in Language.Haskell.Syntax.Expr -- See Note [Expanding HsDo with XXExprGhcRn] Equation (1) below -- stmts ~~> stmts' @@ -121,7 +121,7 @@ expand_do_stmts doFlavour (stmt@(L loc (BodyStmt _ (L e_lspan e) (SyntaxExprRn t -- e ; stmts ~~> (>>) e stmts' do expand_stmts_expr <- expand_do_stmts doFlavour lstmts let expansion = genHsExpApps then_op -- (>>) - [ L e_lspan (mkExpandedStmt stmt doFlavour e) + [ wrapGenSpan e , expand_stmts_expr ] return $ L loc (mkExpandedStmt stmt doFlavour expansion) ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -1865,10 +1865,6 @@ checkMissingFields con_like rbinds arg_tys tcExpandExpr :: HsExpr GhcRn -> TcM (HsExpr GhcRn) tcExpandExpr orig_expr@(HsDo _ flav (L _ stmts)) = do { expanded_expr <- expandDoStmts flav stmts - -- We lose the location on the first statement location in GhcTc, unfortunately. - -- It is needed for get the pattern match warnings right cf. T14546d - -- That location is currently recovered from the location stored in StmtErrCtxt - -- in dsExpr of ExpandedThingTc ; return (mkExpandedLExpr orig_expr expanded_expr) } tcExpandExpr e = return e ===================================== testsuite/tests/ghci/prog-mhu001/prog-mhu001c.stdout ===================================== @@ -9,6 +9,7 @@ e/E.hs:(15,3)-(15,6): GHC.Internal.Types.Int -> GHC.Internal.Base.String e/E.hs:(22,3)-(22,6): E.E -> GHC.Internal.Base.String e/E.hs:(25,3)-(25,10): GHC.Internal.Base.String -> GHC.Internal.Types.IO () e/E.hs:(25,12)-(25,37): GHC.Internal.Base.String +e/E.hs:(25,3)-(25,37): GHC.Internal.Types.IO () e/E.hs:(24,16)-(25,37): GHC.Internal.Types.IO () e/E.hs:(19,9)-(19,9): E.E e/E.hs:(5,7)-(5,8): GHC.Internal.Bignum.Integer.Integer View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7ef903c67692379bbf4cfb93e4f380db... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7ef903c67692379bbf4cfb93e4f380db... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Apoorv Ingle (@ani)