summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2021-05-12 21:57:48 +0100
committerAlan Zimmerman <alan.zimm@gmail.com>2021-06-14 19:14:47 +0100
commit16ad4246cde9576d5bc327126ac3160517fd57b6 (patch)
tree5f05035d60c44c08dd1acefcf9e0bc6f410cddeb /compiler/GHC/Parser
parentaa68e6d6f8b1d87c42ceaa9cd05471af42c0a3f0 (diff)
downloadhaskell-16ad4246cde9576d5bc327126ac3160517fd57b6.tar.gz
EPA: Remove duplicate annotations from HsDataDefn
They are repeated in the surrounding DataDecl and FamEqn. Updates haddock submodule Closes #19834 (cherry picked from commit 10ae305e4ef05e1817ba92fb1d7a7079612c78a3)
Diffstat (limited to 'compiler/GHC/Parser')
-rw-r--r--compiler/GHC/Parser/PostProcess.hs16
1 files changed, 7 insertions, 9 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs
index aa908f068d..9ca63e5b50 100644
--- a/compiler/GHC/Parser/PostProcess.hs
+++ b/compiler/GHC/Parser/PostProcess.hs
@@ -216,8 +216,8 @@ mkTyData loc' new_or_data cType (L _ (mcxt, tycl_hdr))
; (tyvars, anns) <- checkTyVars (ppr new_or_data) equalsDots tc tparams
; cs <- getCommentsFor (locA loc) -- Get any remaining comments
; let anns' = addAnns (EpAnn (spanAsAnchor $ locA loc) annsIn emptyComments) (ann ++ anns) cs
- ; defn <- mkDataDefn new_or_data cType mcxt ksig data_cons maybe_deriv anns'
- ; return (L loc (DataDecl { tcdDExt = anns', -- AZ: do we need these?
+ ; defn <- mkDataDefn new_or_data cType mcxt ksig data_cons maybe_deriv
+ ; return (L loc (DataDecl { tcdDExt = anns',
tcdLName = tc, tcdTyVars = tyvars,
tcdFixity = fixity,
tcdDataDefn = defn })) }
@@ -228,11 +228,10 @@ mkDataDefn :: NewOrData
-> Maybe (LHsKind GhcPs)
-> [LConDecl GhcPs]
-> HsDeriving GhcPs
- -> EpAnn [AddEpAnn]
-> P (HsDataDefn GhcPs)
-mkDataDefn new_or_data cType mcxt ksig data_cons maybe_deriv ann
+mkDataDefn new_or_data cType mcxt ksig data_cons maybe_deriv
= do { checkDatatypeContext mcxt
- ; return (HsDataDefn { dd_ext = ann
+ ; return (HsDataDefn { dd_ext = noExtField
, dd_ND = new_or_data, dd_cType = cType
, dd_ctxt = mcxt
, dd_cons = data_cons
@@ -310,12 +309,11 @@ mkDataFamInst :: SrcSpan
mkDataFamInst loc new_or_data cType (mcxt, bndrs, tycl_hdr)
ksig data_cons (L _ maybe_deriv) anns
= do { (tc, tparams, fixity, ann) <- checkTyClHdr False tycl_hdr
- ; -- AZ:TODO: deal with these comments
- ; cs <- getCommentsFor loc -- Add any API Annotations to the top SrcSpan [temp]
+ ; cs <- getCommentsFor loc -- Add any API Annotations to the top SrcSpan
; let anns' = addAnns (EpAnn (spanAsAnchor loc) ann cs) anns emptyComments
- ; defn <- mkDataDefn new_or_data cType mcxt ksig data_cons maybe_deriv anns'
+ ; defn <- mkDataDefn new_or_data cType mcxt ksig data_cons maybe_deriv
; return (L (noAnnSrcSpan loc) (DataFamInstD anns' (DataFamInstDecl
- (FamEqn { feqn_ext = noAnn -- AZ: get anns
+ (FamEqn { feqn_ext = anns'
, feqn_tycon = tc
, feqn_bndrs = bndrs
, feqn_pats = tparams