Skip to content

Commit

Permalink
Support building with th-abstraction-0.5.*
Browse files Browse the repository at this point in the history
This requires some CPP to silence an `-Wincomplete-patterns` warning.
  • Loading branch information
RyanGlScott committed Feb 27, 2023
1 parent fe2dfea commit 3f82585
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aeson.cabal
Expand Up @@ -138,7 +138,7 @@ library
, strict >=0.4 && <0.5
, tagged >=0.8.6 && <0.9
, text-short >=0.1.5 && <0.2
, th-abstraction >=0.3.0.0 && <0.5
, th-abstraction >=0.3.0.0 && <0.6
, these >=1.1.1.1 && <1.2
, unordered-containers >=0.2.10.0 && <0.3
, uuid-types >=1.0.5 && <1.1
Expand Down
5 changes: 4 additions & 1 deletion src/Data/Aeson/TH.hs
Expand Up @@ -138,7 +138,7 @@ import Data.Maybe (catMaybes, fromMaybe, mapMaybe)
import qualified Data.Monoid as Monoid
import Data.Set (Set)
import Language.Haskell.TH hiding (Arity)
import Language.Haskell.TH.Datatype
import Language.Haskell.TH.Datatype as Datatype
#if MIN_VERSION_template_haskell(2,8,0) && !(MIN_VERSION_template_haskell(2,10,0))
import Language.Haskell.TH.Syntax (mkNameG_tc)
#endif
Expand Down Expand Up @@ -1456,6 +1456,9 @@ buildTypeInstance tyConName jc dataCxt varTysOrig variant = do
Newtype -> False
DataInstance -> True
NewtypeInstance -> True
#if MIN_VERSION_th_abstraction(0,5,0)
Datatype.TypeData -> False
#endif

remainingTysOrigSubst' :: [Type]
-- See Note [Kind signatures in derived instances] for an explanation
Expand Down

0 comments on commit 3f82585

Please sign in to comment.