summaryrefslogtreecommitdiff
path: root/compiler/typecheck/TcErrors.hs
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2017-02-17 12:13:14 +0200
committerAlan Zimmerman <alan.zimm@gmail.com>2017-02-18 20:40:09 +0200
commit43a082bb59310d10d3c7550d5cbeaab384ca4c76 (patch)
tree4aa60f80be7e87ede1db0af69e2c3e20d14d16a9 /compiler/typecheck/TcErrors.hs
parent98e494afed3c73f88ff1d57a9ca46b1f6ddbd1b9 (diff)
downloadhaskell-wip/embelleshed-rdr.tar.gz
Add HsEmbellished type to hsSynwip/embelleshed-rdr
Summary: A RdrName can be parsed with parens or backquotes if it is used prefix or infix respectively when it is normally not used that way. This is not captured in hsSyn, and must be inferred from the occName when pretty printing, or using the API annotations. Introduce a wrapper type around the name to capture this data Embellished name = EName name | EParens (Located name) | EBackquotes (Located name) So that we now have data HsExpr id = HsVar (LEmbellished id) -- ^ Variable and in the other relevant points in hsSyn. Test Plan: ./validate Reviewers: bgamari, austin, goldfire Subscribers: goldfire, thomie, mpickering, snowleopard Differential Revision: https://phabricator.haskell.org/D3145
Diffstat (limited to 'compiler/typecheck/TcErrors.hs')
-rw-r--r--compiler/typecheck/TcErrors.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs
index 6d4e3def8c..1f9d253f01 100644
--- a/compiler/typecheck/TcErrors.hs
+++ b/compiler/typecheck/TcErrors.hs
@@ -30,6 +30,7 @@ import DataCon
import TcEvidence
import HsExpr ( UnboundVar(..) )
import HsBinds ( PatSynBind(..) )
+import HsEmbellished
import Name
import RdrName ( lookupGlobalRdrEnv, lookupGRE_Name, GlobalRdrEnv
, mkRdrUnqual, isLocalGRE, greSrcSpan )
@@ -2347,7 +2348,7 @@ ctxtFixes has_ambig_tvs pred implics
discardProvCtxtGivens :: CtOrigin -> [UserGiven] -> [UserGiven]
discardProvCtxtGivens orig givens -- See Note [discardProvCtxtGivens]
| ProvCtxtOrigin (PSB {psb_id = L _ name}) <- orig
- = filterOut (discard name) givens
+ = filterOut (discard $ unEmb name) givens
| otherwise
= givens
where