From 632f6255df614e193105d3db78ca8cd2a437c7ed Mon Sep 17 00:00:00 2001 From: Philip Patsch Date: Mon, 8 Apr 2024 11:42:24 +0200 Subject: [PATCH] Meta: add HsProjection for GHC >9.6 It was missing, so record projection functions like `(.myfield.nested)` did not work anymore. Fixes https://github.com/guibou/PyF/issues/135 --- src/PyF/Internal/Meta.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PyF/Internal/Meta.hs b/src/PyF/Internal/Meta.hs index 5f79585..000b500 100644 --- a/src/PyF/Internal/Meta.hs +++ b/src/PyF/Internal/Meta.hs @@ -260,6 +260,7 @@ toExp _ (HsOverLabel _ Nothing lbl) = TH.LabelE (unpackFS lbl) #endif #if MIN_VERSION_ghc(9,6,0) toExp dynFlags (HsGetField _ expr field) = TH.GetFieldE (toExp dynFlags (unLoc expr)) (unpackFS . field_label . unLoc . dfoLabel . unLoc $ field) +toExp _ (HsProjection _ fields) = TH.ProjectionE (fmap (unpackFS . unLoc . fmap field_label . dfoLabel . unLoc) fields) #elif MIN_VERSION_ghc(9, 4, 0) toExp dynFlags (HsGetField _ expr field) = TH.GetFieldE (toExp dynFlags (unLoc expr)) (unpackFS . unLoc . dfoLabel . unLoc $ field) toExp _ (HsProjection _ fields) = TH.ProjectionE (fmap (unpackFS . unLoc . dfoLabel . unLoc) fields)