summaryrefslogtreecommitdiff
path: root/libraries/template-haskell
diff options
context:
space:
mode:
authorMichael Sloan <mgsloan@gmail.com>2018-07-12 10:07:28 -0400
committerBen Gamari <ben@smart-cactus.org>2018-07-12 15:04:05 -0400
commit0f79b0ef140e086a48d1aa5b945ad5a3754ccdd1 (patch)
treeab69d7ca75deac90c285e0e982c4a1bd3a92a288 /libraries/template-haskell
parent234093cf1562d032b38382a5cc08be8dd71c4fe3 (diff)
downloadhaskell-0f79b0ef140e086a48d1aa5b945ad5a3754ccdd1.tar.gz
Fix handling of unbound constructor names in TH #14627
Also adds a comment to UnboundVarE clarifying that it also is used for unbound constructor identifiers, since that isn't very clear from the name. Test Plan: testsuite/tests/th/T14627.hs Reviewers: goldfire, bgamari Reviewed By: goldfire Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4923
Diffstat (limited to 'libraries/template-haskell')
-rw-r--r--libraries/template-haskell/Language/Haskell/TH/Syntax.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
index 9665c65cf4..f5f60c38b4 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
@@ -1620,7 +1620,12 @@ data Exp
| RecConE Name [FieldExp] -- ^ @{ T { x = y, z = w } }@
| RecUpdE Exp [FieldExp] -- ^ @{ (f x) { z = w } }@
| StaticE Exp -- ^ @{ static e }@
- | UnboundVarE Name -- ^ @{ _x }@ (hole)
+ | UnboundVarE Name -- ^ @{ _x }@
+ --
+ -- This is used for holes or unresolved
+ -- identifiers in AST quotes. Note that
+ -- it could either have a variable name
+ -- or constructor name.
| LabelE String -- ^ @{ #x }@ ( Overloaded label )
deriving( Show, Eq, Ord, Data, Generic )