[Git][ghc/ghc][wip/expand-do] Add the statement context in addHeadCtxt

Apoorv Ingle (@ani) gitlab at gitlab.haskell.org
Thu Jul 13 01:37:27 UTC 2023



Apoorv Ingle pushed to branch wip/expand-do at Glasgow Haskell Compiler / GHC


Commits:
257c8fc2 by Apoorv Ingle at 2023-07-12T20:22:49-05:00
Add the statement context in addHeadCtxt

- - - - -


1 changed file:

- compiler/GHC/Tc/Gen/Head.hs


Changes:

=====================================
compiler/GHC/Tc/Gen/Head.hs
=====================================
@@ -829,11 +829,10 @@ tcInferAppHead_maybe fun args
       _                         -> return Nothing
 
 addHeadCtxt :: AppCtxt -> TcM a -> TcM a
--- addHeadCtxt (VAExpansionStmt stmt@(L stmt_loc _) _) thing_inside =
---   do setSrcSpanA stmt_loc $
---        addStmtCtxt (text "addHeadCtxt") stmt
---          thing_inside
-
+addHeadCtxt (VAExpansionStmt stmt@(L stmt_loc _)) thing_inside =
+  do setSrcSpanA stmt_loc $
+       addStmtCtxt (text "addHeadCtxt") stmt
+         thing_inside
 addHeadCtxt fun_ctxt thing_inside
   | not (isGoodSrcSpan fun_loc)   -- noSrcSpan => no arguments
   = do traceTc "addHeadCtxt not good" (ppr fun_ctxt)
@@ -843,7 +842,6 @@ addHeadCtxt fun_ctxt thing_inside
     do traceTc "addHeadCtxt okay" (ppr fun_ctxt)
        case fun_ctxt of
          VAExpansion orig _ -> addExprCtxt (text "addHeadCtxt") orig thing_inside
-         VAExpansionStmt {} -> thing_inside
          VACall {}          -> thing_inside
   where
     fun_loc = appCtxtLoc fun_ctxt



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/257c8fc24d49de94d25dcc80c1aa7786a4557042

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/257c8fc24d49de94d25dcc80c1aa7786a4557042
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230712/58837055/attachment-0001.html>


More information about the ghc-commits mailing list