From 93719a1d2c6a62e5f339930101189c0586c67dd5 Mon Sep 17 00:00:00 2001 From: Ziyang Liu Date: Thu, 12 Dec 2024 18:53:46 -0800 Subject: [PATCH] Update stripLocalBind for GHC 9.12 --- src/Refact/Internal.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Refact/Internal.hs b/src/Refact/Internal.hs index f2f5569..69338dd 100644 --- a/src/Refact/Internal.hs +++ b/src/Refact/Internal.hs @@ -525,9 +525,13 @@ stripLocalBind = \case | let origMG = GHC.fun_matches origBind, GHC.L locMG [GHC.L locMatch origMatch] <- GHC.mg_alts origMG, let origGRHSs = GHC.m_grhss origMatch, +#if MIN_VERSION_ghc(9,12,0) + [GHC.L loc2 _] <- GHC.grhssGRHSs origGRHSs -> +#else [GHC.L _ (GHC.GRHS _ _ (GHC.L loc2 _))] <- GHC.grhssGRHSs origGRHSs -> +#endif let loc1 = GHC.getLoc (GHC.fun_id origBind) - newLoc = combineSrcSpansA (GHC.l2l loc1) loc2 + newLoc = combineSrcSpansA (GHC.l2l loc1) (GHC.l2l loc2) withoutLocalBinds = setLocalBind (GHC.EmptyLocalBinds GHC.noExtField)