Skip to content

Commit 7593baa

Browse files
committed
fix: Fix build for GHC 9.10, 9.12
1 parent b7e7e7a commit 7593baa

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

plugins/hls-change-type-signature-plugin/src/Ide/Plugin/ChangeTypeSignature.hs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE LambdaCase #-}
23
{-# LANGUAGE ViewPatterns #-}
34
-- | An HLS plugin to provide code actions to change type signatures
@@ -169,7 +170,11 @@ findSolverReport (TcRnMessageWithInfo _ (TcRnMessageDetailed errInfo msg)) =
169170
case findSolverReport msg of
170171
Just (mismatch, _) -> Just (mismatch, Just errInfo)
171172
_ -> Nothing
173+
#if MIN_VERSION_ghc(9,10,0)
174+
findSolverReport (TcRnSolverReport (SolverReportWithCtxt _ mismatch) _) =
175+
#else
172176
findSolverReport (TcRnSolverReport (SolverReportWithCtxt _ mismatch) _ _) =
177+
#endif
173178
Just (mismatch, Nothing)
174179
findSolverReport _ = Nothing
175180

@@ -181,7 +186,11 @@ findMismatchMessage _ = Nothing
181186

182187
-- TODO: Make this a prism?
183188
findTypeEqMismatch :: MismatchMsg -> Maybe (Type, Type)
189+
#if MIN_VERSION_ghc(9,12,0)
190+
findTypeEqMismatch (TypeEqMismatch _ _ _ expected actual _ _) =
191+
#else
184192
findTypeEqMismatch (TypeEqMismatch _ _ _ _ expected actual _ _) =
193+
#endif
185194
Just (expected, actual)
186195
findTypeEqMismatch _ = Nothing
187196

0 commit comments

Comments
 (0)