Skip to content

Commit 75185fe

Browse files
committed
Manual GLASGOW_HASKELL bits
1 parent 57a91c3 commit 75185fe

File tree

4 files changed

+3
-20
lines changed

4 files changed

+3
-20
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,6 @@ ghcVersion = GHC96
537537
ghcVersion = GHC94
538538
#elif MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
539539
ghcVersion = GHC92
540-
#elif MIN_VERSION_GLASGOW_HASKELL(9,0,0,0)
541-
ghcVersion = GHC90
542-
#elif MIN_VERSION_GLASGOW_HASKELL(8,10,0,0)
543-
ghcVersion = GHC810
544540
#endif
545541

546542
runUnlit :: Logger -> DynFlags -> [Option] -> IO ()

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -596,31 +596,24 @@ pattern RealSrcLoc x y = SrcLoc.RealSrcLoc x y
596596
pattern AvailTC :: Name -> [Name] -> [FieldLabel] -> Avail.AvailInfo
597597
#if __GLASGOW_HASKELL__ >= 907
598598
pattern AvailTC n names pieces <- Avail.AvailTC n ((,[]) -> (names,pieces))
599-
#elif __GLASGOW_HASKELL__ >= 902
599+
#else
600600
pattern AvailTC n names pieces <- Avail.AvailTC n ((\gres -> foldr (\gre (names, pieces) -> case gre of
601601
Avail.NormalGreName name -> (name: names, pieces)
602602
Avail.FieldGreName label -> (names, label:pieces)) ([], []) gres) -> (names, pieces))
603-
#else
604-
pattern AvailTC n names pieces <- Avail.AvailTC n names pieces
605603
#endif
606604

607605
pattern AvailName :: Name -> Avail.AvailInfo
608606
#if __GLASGOW_HASKELL__ >= 907
609607
pattern AvailName n <- Avail.Avail n
610-
#elif __GLASGOW_HASKELL__ >= 902
608+
#else
611609
pattern AvailName n <- Avail.Avail (Avail.NormalGreName n)
612-
#else
613-
pattern AvailName n <- Avail.Avail n
614610
#endif
615611

616612
pattern AvailFL :: FieldLabel -> Avail.AvailInfo
617613
#if __GLASGOW_HASKELL__ >= 907
618614
pattern AvailFL fl <- (const Nothing -> Just fl) -- this pattern always fails as this field was removed in 9.7
619-
#elif __GLASGOW_HASKELL__ >= 902
615+
#else
620616
pattern AvailFL fl <- Avail.Avail (Avail.FieldGreName fl)
621-
#else
622-
-- pattern synonym that is never populated
623-
pattern AvailFL x <- Avail.Avail (const (True, undefined) -> (False, x))
624617
#endif
625618

626619
{-# COMPLETE AvailTC, AvailName, AvailFL #-}

ghcide/test/data/hover/RecordDotSyntax.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{-# LANGUAGE CPP #-}
2-
#if __GLASGOW_HASKELL__ >= 902
31
{-# LANGUAGE OverloadedRecordDot, DuplicateRecordFields, NoFieldSelectors #-}
42

53
module RecordDotSyntax ( module RecordDotSyntax) where
@@ -18,4 +16,3 @@ newtype MyChild = MyChild
1816

1917
x = MyRecord { a = "Hello", b = 12, c = MyChild { z = "there" } }
2018
y = x.a ++ show x.b ++ x.c.z
21-
#endif

plugins/hls-refactor-plugin/test/data/hover/RecordDotSyntax.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{-# LANGUAGE CPP #-}
2-
#if __GLASGOW_HASKELL__ >= 902
31
{-# LANGUAGE OverloadedRecordDot, DuplicateRecordFields, NoFieldSelectors #-}
42

53
module RecordDotSyntax ( module RecordDotSyntax) where
@@ -18,4 +16,3 @@ newtype MyChild = MyChild
1816

1917
x = MyRecord { a = "Hello", b = 12, c = MyChild { z = "there" } }
2018
y = x.a ++ show x.b ++ x.c.z
21-
#endif

0 commit comments

Comments
 (0)