Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build for 9.2 and 9.4 #155

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Refact/Compat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ import GHC.Driver.Session hiding (initDynFlags)
#if MIN_VERSION_ghc(9,6,0)
import GHC.Hs hiding (Pat, Stmt, parseModuleName, ann)
#else
import GHC.Hs hiding (Pat, Stmt)
import GHC.Hs hiding (Pat, Stmt, ann)
#endif
import GHC.Parser.Header (getOptions)
#if MIN_VERSION_ghc(9,8,0)
Expand Down Expand Up @@ -301,8 +301,10 @@ commentSrcSpan :: GHC.LEpaComment -> SrcSpan
#if MIN_VERSION_ghc(9,12,0)
commentSrcSpan (GHC.L (GHC.EpaSpan l) _) = l
commentSrcSpan (GHC.L (GHC.EpaDelta l _ _) _) = l
#else
#elif MIN_VERSION_ghc(9,4,0)
commentSrcSpan (GHC.L (GHC.Anchor l _) _) = GHC.RealSrcSpan l Strict.Nothing
#else
commentSrcSpan (GHC.L (GHC.Anchor l _) _) = GHC.RealSrcSpan l Nothing
#endif

#if MIN_VERSION_ghc(9,12,0)
Expand Down
19 changes: 11 additions & 8 deletions src/Refact/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ import Language.Haskell.GHC.ExactPrint.Types
-- epRigidity,
-- Rigidity(..),
#endif
#if MIN_VERSION_ghc(9,12,0)
import Language.Haskell.GHC.ExactPrint.Utils (showAst)
#else
import Language.Haskell.GHC.ExactPrint.ExactPrint (showAst)
#endif
-- #if MIN_VERSION_ghc(9,12,0)
-- import Language.Haskell.GHC.ExactPrint.Utils (showAst)
-- #else
-- import Language.Haskell.GHC.ExactPrint.ExactPrint (showAst)
-- #endif
import Language.Haskell.GHC.ExactPrint.Utils (ss2pos)
import Refact.Compat
( AnnSpan,
Expand Down Expand Up @@ -116,9 +116,12 @@ import Refact.Compat
ann,
#endif

#if MIN_VERSION_ghc(9,4,0)
mkGeneratedHsDocString,
initParserOpts, AnnConstraint

initParserOpts,
#else
#endif
AnnConstraint
)
import Refact.Types hiding (SrcSpan)
import qualified Refact.Types as R
Expand Down Expand Up @@ -593,7 +596,7 @@ combineSrcSpansLW :: GHC.SrcSpanAnnA -> GHC.SrcSpanAnnLW -> GHC.SrcSpanAnnLW
combineSrcSpansLW (GHC.EpAnn anca _ csa) (GHC.EpAnn ancb anb csb)
= GHC.EpAnn (anca <> ancb) anb (csa <> csb)
#else
combineSrcSpansLW :: Semigroup a => GHC.SrcAnn a -> GHC.SrcAnn a -> GHC.SrcAnn a
combineSrcSpansLW :: Semigroup a => GHC.SrcAnn a -> GHC.SrcAnn a -> GHC.SrcAnn a
combineSrcSpansLW = combineSrcSpansA
#endif

Expand Down
Loading