diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2022-07-01 12:52:29 +0100 |
---|---|---|
committer | Alan Zimmerman <alan.zimm@gmail.com> | 2022-07-07 22:27:03 +0100 |
commit | 270053d4f3391d9bf8134e75730a1181d2dea06c (patch) | |
tree | 4a6ce09eb59791f60d9460634e885efeabdfae29 /compiler/GHC/Parser/PostProcess.hs | |
parent | bbcaba6a0951d45ae0ceb309da5458fc20332511 (diff) | |
download | haskell-wip/az/T21805.tar.gz |
EPA: DotFieldOcc does not have exact print annotationswip/az/T21805
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/PostProcess.hs')
-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 |