Skip to content

Commit b7f110f

Browse files
committed
NFData FieldLabel when GHC < 906
1 parent 67187b5 commit b7f110f

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

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

+19-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
-- | Orphan instances for GHC.
88
-- Note that the 'NFData' instances may not be law abiding.
99
module Development.IDE.GHC.Orphans() where
10-
import Development.IDE.GHC.Compat
10+
import Development.IDE.GHC.Compat hiding
11+
(DuplicateRecordFields,
12+
FieldSelectors)
1113
import Development.IDE.GHC.Util
1214

1315
import Control.DeepSeq
@@ -23,9 +25,10 @@ import GHC.Data.Bag
2325
import GHC.Data.FastString
2426
import qualified GHC.Data.StringBuffer as SB
2527
import GHC.Parser.Annotation
26-
import GHC.Types.SrcLoc
27-
28+
import GHC.Types.FieldLabel (DuplicateRecordFields (DuplicateRecordFields, NoDuplicateRecordFields),
29+
FieldSelectors (FieldSelectors, NoFieldSelectors))
2830
import GHC.Types.PkgQual
31+
import GHC.Types.SrcLoc
2932

3033
-- See Note [Guidelines For Using CPP In GHCIDE Import Statements]
3134

@@ -237,3 +240,16 @@ instance NFData Extension where
237240

238241
instance NFData (UniqFM Name [Name]) where
239242
rnf (ufmToIntMap -> m) = rnf m
243+
244+
#if !MIN_VERSION_ghc(9,5,0)
245+
instance NFData DuplicateRecordFields where
246+
rnf DuplicateRecordFields = ()
247+
rnf NoDuplicateRecordFields = ()
248+
249+
instance NFData FieldSelectors where
250+
rnf FieldSelectors = ()
251+
rnf NoFieldSelectors = ()
252+
253+
instance NFData FieldLabel where
254+
rnf (FieldLabel a b c d) = rnf a `seq` rnf b `seq` rnf c `seq` rnf d
255+
#endif

0 commit comments

Comments
 (0)