Skip to content

Commit

Permalink
Update stripLocalBind for GHC 9.12 (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
zliu41 authored Dec 13, 2024
1 parent c5738cc commit a9fe689
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Refact/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a9fe689

Please sign in to comment.