Skip to content

Commit a9fe689

Browse files
authored
Update stripLocalBind for GHC 9.12 (#154)
1 parent c5738cc commit a9fe689

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Refact/Internal.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,13 @@ stripLocalBind = \case
525525
| let origMG = GHC.fun_matches origBind,
526526
GHC.L locMG [GHC.L locMatch origMatch] <- GHC.mg_alts origMG,
527527
let origGRHSs = GHC.m_grhss origMatch,
528+
#if MIN_VERSION_ghc(9,12,0)
529+
[GHC.L loc2 _] <- GHC.grhssGRHSs origGRHSs ->
530+
#else
528531
[GHC.L _ (GHC.GRHS _ _ (GHC.L loc2 _))] <- GHC.grhssGRHSs origGRHSs ->
532+
#endif
529533
let loc1 = GHC.getLoc (GHC.fun_id origBind)
530-
newLoc = combineSrcSpansA (GHC.l2l loc1) loc2
534+
newLoc = combineSrcSpansA (GHC.l2l loc1) (GHC.l2l loc2)
531535
withoutLocalBinds =
532536
setLocalBind
533537
(GHC.EmptyLocalBinds GHC.noExtField)

0 commit comments

Comments
 (0)