@@ -29,7 +29,6 @@ import Ormolu.Printer.Meat.Declaration.Signature
2929import Ormolu.Printer.Meat.Type
3030import Ormolu.Printer.Operators
3131import Ormolu.Utils
32−import Outputable (Outputable (..))
3332import RdrName (rdrNameOcc)
3433import SrcLoc (combineSrcSpans, isOneLineSpan)
3534import qualified Data.List.NonEmpty as NE
@@ -469,11 +468,10 @@ p_hsLocalBinds = \case
469468 XHsLocalBindsLR _ -> notImplemented "XHsLocalBindsLR"
470469
471470p_hsRecField
472− :: (Data id, Outputable id)
473− => HsRecField' id (LHsExpr GhcPs)
471+ :: HsRecField' RdrName (LHsExpr GhcPs)
474472 -> R ()
475473p_hsRecField = \HsRecField {..} -> do
476− located hsRecFieldLbl atom
474+ p_rdrName hsRecFieldLbl
477475 unless hsRecPun $ do
478476 space
479477 txt "="
@@ -630,7 +628,12 @@ p_hsExpr = \case
630628 located rcon_con_name atom
631629 breakpoint
632630 let HsRecFields {..} = rcon_flds
633− fields = located' p_hsRecField <$> rec_flds
631+ updName f = f {
632+ hsRecFieldLbl = case unLoc $ hsRecFieldLbl f of
633+ FieldOcc _ n -> n
634+ XFieldOcc _ -> notImplemented "XFieldOcc"
635+ }
636+ fields = located' (p_hsRecField . updName) <$> rec_flds
634637 dotdot =
635638 case rec_dotdot of
636639 Just {} -> [txt ".."]
@@ -639,8 +642,17 @@ p_hsExpr = \case
639642 RecordUpd {..} -> do
640643 located rupd_expr p_hsExpr
641644 breakpoint
645+ let updName f = f {
646+ hsRecFieldLbl = case unLoc $ hsRecFieldLbl f of
647+ Ambiguous _ n -> n
648+ Unambiguous _ n -> n
649+ XAmbiguousFieldOcc _ -> notImplemented "XAmbiguousFieldOcc"
650+ }
642651 inci . braces . sitcc $
643− sep (comma >> breakpoint) (sitcc . located' p_hsRecField) rupd_flds
652+ sep
653+ (comma >> breakpoint)
654+ (sitcc . located' (p_hsRecField . updName))
655+ rupd_flds
644656 ExprWithTySig affix x -> sitcc $ do
645657 located x p_hsExpr
646658 breakpoint