Commit c8873b52 authored by Alan Zimmerman's avatar Alan Zimmerman Committed by Marge Bot
Browse files

Api Annotations : Adjust SrcSpans for prefix bang (!).

And prefix ~

(cherry picked from commit 8dbee2c5)
parent a11c9678
Pipeline #23193 canceled with stages
......@@ -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 = []
......
......@@ -39,7 +39,8 @@ listcomps:
.PHONY: T10358
T10358:
$(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test10358.hs
# Ignore result code, we have an unattached (superfluous) AnnBang
- $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test10358.hs
.PHONY: T10396
T10396:
......
---Unattached Annotation Problems (should be empty list)---
[]
[(AnnBang, Test10358.hs:5:19)]
---Ann before enclosing span problem (should be empty list)---
[
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment