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/Rename/Names.hs | |
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/Rename/Names.hs')
-rw-r--r-- | compiler/GHC/Rename/Names.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs index 83f254b132..daaf128ea1 100644 --- a/compiler/GHC/Rename/Names.hs +++ b/compiler/GHC/Rename/Names.hs @@ -86,6 +86,8 @@ import GHC.Data.Maybe import GHC.Data.FastString import GHC.Data.FastString.Env +import Language.Haskell.Syntax.Basic (FieldLabelString(..)) + import Control.Monad import Data.Either ( partitionEithers ) import Data.Map ( Map ) @@ -993,7 +995,7 @@ getLocalNonValBinders fixity_env find_con_decl_fld (L _ (FieldOcc _ (L _ rdr))) = expectJust "getLocalNonValBinders/find_con_decl_fld" $ find (\ fl -> flLabel fl == lbl) flds - where lbl = occNameFS (rdrNameOcc rdr) + where lbl = FieldLabelString $ occNameFS (rdrNameOcc rdr) new_assoc :: DuplicateRecordFields -> FieldSelectors -> LInstDecl GhcPs -> RnM ([AvailInfo], [(Name, [FieldLabel])]) @@ -1055,7 +1057,7 @@ newRecordSelector dup_fields_ok has_sel (dc:_) (L loc (FieldOcc _ (L _ fld))) , flHasFieldSelector = has_sel , flSelector = selName } } where - fieldLabelString = occNameFS $ rdrNameOcc fld + fieldLabelString = FieldLabelString $ occNameFS $ rdrNameOcc fld selOccName = fieldSelectorOccName fieldLabelString (nameOccName dc) dup_fields_ok has_sel field | isExact fld = fld -- use an Exact RdrName as is to preserve the bindings |