diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2022-07-01 12:52:29 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-08-11 16:19:57 -0400 |
commit | ff67c79ee742024ca0ef41a9a7e540e1662d46bd (patch) | |
tree | 6588e16a80e86696f7541c483a724903b82ad492 /compiler/GHC/Parser | |
parent | 5c24b1b3a9d6a4c2f471fd7d8ec65141a8b46357 (diff) | |
download | haskell-ff67c79ee742024ca0ef41a9a7e540e1662d46bd.tar.gz |
EPA: DotFieldOcc does not have exact print annotations
For the code
{-# LANGUAGE OverloadedRecordUpdate #-}
operatorUpdate f = f{(+) = 1}
There are no exact print annotations for the parens around the +
symbol, nor does normal ppr print them.
This MR fixes that.
Closes #21805
Updates haddock submodule
Diffstat (limited to 'compiler/GHC/Parser')
-rw-r--r-- | compiler/GHC/Parser/PostProcess.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs index 3f99b1bfa4..9cce37e051 100644 --- a/compiler/GHC/Parser/PostProcess.hs +++ b/compiler/GHC/Parser/PostProcess.hs @@ -157,6 +157,8 @@ import GHC.Utils.Panic import GHC.Utils.Panic.Plain import qualified GHC.Data.Strict as Strict +import Language.Haskell.Syntax.Basic (FieldLabelString(..)) + import Control.Monad import Text.ParserCombinators.ReadP as ReadP import Data.Char @@ -2561,7 +2563,7 @@ mkRdrRecordUpd overloaded_on exp@(L loc _) fbinds anns = do recFieldToProjUpdate (L l (HsFieldBind anns (L _ (FieldOcc _ (L loc rdr))) arg pun)) = -- The idea here is to convert the label to a singleton [FastString]. let f = occNameFS . rdrNameOcc $ rdr - fl = DotFieldOcc noAnn (L (l2l loc) f) -- AZ: what about the ann? + fl = DotFieldOcc noAnn (L loc (FieldLabelString f)) lf = locA loc in mkRdrProjUpdate l (L lf [L (l2l loc) fl]) (punnedVar f) pun anns where |