summaryrefslogtreecommitdiff
path: root/compiler/parser/RdrHsSyn.hs
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2019-02-02 16:29:05 +0200
committerAlan Zimmerman <alan.zimm@gmail.com>2019-02-03 10:31:00 +0200
commit3200c30f1f7af2a3fa54773129cb21a5c72527d2 (patch)
tree83689b36b1d0c35bce9637645ae81ddc9faee6ea /compiler/parser/RdrHsSyn.hs
parent71dae4eb1a4891fc1a428caf70a06830864ffdc3 (diff)
downloadhaskell-wip/T16265.tar.gz
API Annotations: parens anns discarded for `(*)` operatorwip/T16265
The patch from ​https://phabricator.haskell.org/D4865 introduces go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix = do { warnStarBndr l ; let name = mkOccName tcClsName (if isUni then "★" else "*") ; return (cL l (Unqual name), acc, fix, ann) } which discards the parens annotations belonging to the HsParTy. Closes #16265
Diffstat (limited to 'compiler/parser/RdrHsSyn.hs')
-rw-r--r--compiler/parser/RdrHsSyn.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs
index 45fc5a0972..13817d86ff 100644
--- a/compiler/parser/RdrHsSyn.hs
+++ b/compiler/parser/RdrHsSyn.hs
@@ -959,10 +959,10 @@ checkTyClHdr is_cls ty
goL (dL->L l ty) acc ann fix = go l ty acc ann fix
-- workaround to define '*' despite StarIsType
- go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix
+ go lp (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix
= do { warnStarBndr l
; let name = mkOccName tcClsName (if isUni then "★" else "*")
- ; return (cL l (Unqual name), acc, fix, ann) }
+ ; return (cL l (Unqual name), acc, fix, (ann ++ mkParensApiAnn lp)) }
go l (HsTyVar _ _ (dL->L _ tc)) acc ann fix
| isRdrTc tc = return (cL l tc, acc, fix, ann)