diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2021-05-12 21:57:48 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-05-19 23:35:59 -0400 |
commit | 10ae305e4ef05e1817ba92fb1d7a7079612c78a3 (patch) | |
tree | d798f2a14b873b35b25b7aa3429a440effeb2705 /compiler/GHC/Parser | |
parent | 327256178e8378c9d5cfd9b1990788d7eca2294f (diff) | |
download | haskell-10ae305e4ef05e1817ba92fb1d7a7079612c78a3.tar.gz |
EPA: Remove duplicate annotations from HsDataDefn
They are repeated in the surrounding DataDecl and FamEqn.
Updates haddock submodule
Closes #19834
Diffstat (limited to 'compiler/GHC/Parser')
-rw-r--r-- | compiler/GHC/Parser/PostProcess.hs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs index beeaeb9d9e..c6ad4db6d1 100644 --- a/compiler/GHC/Parser/PostProcess.hs +++ b/compiler/GHC/Parser/PostProcess.hs @@ -215,8 +215,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 })) } @@ -227,11 +227,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 @@ -309,12 +308,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 |