diff options
author | Michael Sloan <mgsloan@gmail.com> | 2018-07-12 10:07:28 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-07-12 15:04:05 -0400 |
commit | 0f79b0ef140e086a48d1aa5b945ad5a3754ccdd1 (patch) | |
tree | ab69d7ca75deac90c285e0e982c4a1bd3a92a288 /libraries/template-haskell | |
parent | 234093cf1562d032b38382a5cc08be8dd71c4fe3 (diff) | |
download | haskell-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.hs | 7 |
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 ) |