Skip to content

Commit 2c9ce63

Browse files
peterwicksstringfieldwz1000
authored andcommitted
Kludge compilation for <=8.8.3.
FunTy takes a third argument in 8.10.1 and on.
1 parent bf8f996 commit 2c9ce63

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

ghcide/src/Development/IDE/GHC/Compat.hs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module Development.IDE.GHC.Compat(
4242
disableWarningsAsErrors,
4343
AvailInfo,
4444
tcg_exports,
45+
pattern FunTy,
4546

4647
#if MIN_GHC_API_VERSION(8,10,0)
4748
module GHC.Hs.Extension,
@@ -89,6 +90,7 @@ import HsExtension
8990
#endif
9091

9192
import qualified GHC
93+
import qualified TyCoRep
9294
import GHC hiding (
9395
ModLocation,
9496
HasSrcSpan,
@@ -283,3 +285,10 @@ pattern ExposePackage s a mr <- DynFlags.ExposePackage s a _ mr
283285
#else
284286
pattern ExposePackage s a mr = DynFlags.ExposePackage s a mr
285287
#endif
288+
289+
pattern FunTy :: Type -> Type -> Type
290+
#if MIN_GHC_API_VERSION(8, 10, 0)
291+
pattern FunTy arg res <- TyCoRep.FunTy {ft_arg = arg, ft_res = res}
292+
#else
293+
pattern FunTy arg res <- TyCoRep.FunTy arg res
294+
#endif

ghcide/src/Development/IDE/Spans/AtPoint.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import Development.IDE.Core.PositionMapping
3232
import Name
3333
import Outputable hiding ((<>))
3434
import SrcLoc
35-
import TyCoRep
35+
import TyCoRep hiding (FunTy)
3636
import TyCon
3737
import qualified Var
3838
import NameEnv
@@ -257,7 +257,7 @@ typeLocationsAtPoint hiedb lookupModule _ideOptions pos (HAR _ ast _ hieKind) =
257257
AppTy a b -> getTypes [a,b]
258258
TyConApp tc ts -> tyConName tc : getTypes ts
259259
ForAllTy _ t -> getTypes [t]
260-
FunTy _ a b -> getTypes [a,b]
260+
FunTy a b -> getTypes [a,b]
261261
CastTy t _ -> getTypes [t]
262262
_ -> []
263263
in fmap nubOrd $ concatMapM (fmap (maybe [] id) . nameToLocation hiedb lookupModule) (getTypes ts)
@@ -338,4 +338,3 @@ pointCommand hf pos k =
338338
sp fs = mkRealSrcSpan (sloc fs) (sloc fs)
339339
line = _line pos
340340
cha = _character pos
341-

0 commit comments

Comments
 (0)