summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser/PostProcess.hs
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2020-08-07 18:52:47 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-08-09 21:17:54 -0400
commitc8873b52f6a16202c3cb839e988c1406b8f67cfe (patch)
treedd360f2e02abdaa8ff6ba1a42116ce1c421a2001 /compiler/GHC/Parser/PostProcess.hs
parenta11c9678409b2e0a01e8aba153e094800f3641bf (diff)
downloadhaskell-c8873b52f6a16202c3cb839e988c1406b8f67cfe.tar.gz
Api Annotations : Adjust SrcSpans for prefix bang (!).
And prefix ~ (cherry picked from commit 8dbee2c578b1f642d45561be3f416119863e01eb)
Diffstat (limited to 'compiler/GHC/Parser/PostProcess.hs')
-rw-r--r--compiler/GHC/Parser/PostProcess.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs
index b061161a56..55e464fad1 100644
--- a/compiler/GHC/Parser/PostProcess.hs
+++ b/compiler/GHC/Parser/PostProcess.hs
@@ -1201,13 +1201,14 @@ makeFunBind fn ms
checkPatBind :: LPat GhcPs
-> Located (a,GRHSs GhcPs (LHsExpr GhcPs))
-> P ([AddAnn],HsBind GhcPs)
-checkPatBind lhs (L match_span (_,grhss))
+checkPatBind lhs (L rhs_span (_,grhss))
| BangPat _ p <- unLoc lhs
, VarPat _ v <- unLoc p
= return ([], makeFunBind v [L match_span (m v)])
where
+ match_span = combineSrcSpans (getLoc lhs) rhs_span
m v = Match { m_ext = noExtField
- , m_ctxt = FunRhs { mc_fun = L (getLoc lhs) (unLoc v)
+ , m_ctxt = FunRhs { mc_fun = v
, mc_fixity = Prefix
, mc_strictness = SrcStrict }
, m_pats = []