summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser.y
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Parser.y')
-rw-r--r--compiler/GHC/Parser.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y
index 4b165b1586..4018155d81 100644
--- a/compiler/GHC/Parser.y
+++ b/compiler/GHC/Parser.y
@@ -1921,7 +1921,7 @@ annotation :: { LHsDecl GhcPs }
(ValueAnnProvenance $2) $3))
[mo $1,mc $4] }
- | '{-# ANN' 'type' tycon aexp '#-}' {% runPV (unECP $4) >>= \ $4 ->
+ | '{-# ANN' 'type' otycon aexp '#-}' {% runPV (unECP $4) >>= \ $4 ->
ams (sLL $1 $> (AnnD noExtField $ HsAnnotation noExtField
(getANN_PRAGs $1)
(TypeAnnProvenance $3) $4))
@@ -3562,6 +3562,12 @@ tyconsym :: { Located RdrName }
| '-' { sL1 $1 $! mkUnqual tcClsName (fsLit "-") }
| '.' { sL1 $1 $! mkUnqual tcClsName (fsLit ".") }
+-- An "ordinary" unqualified tycon. See `oqtycon` for the qualified version.
+-- These can appear in `ANN type` declarations (#19374).
+otycon :: { Located RdrName }
+ : tycon { $1 }
+ | '(' tyconsym ')' {% ams (sLL $1 $> (unLoc $2))
+ [mop $1,mj AnnVal $2,mcp $3] }
-----------------------------------------------------------------------------
-- Operators