diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index dc3c98e..be81a74 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -6,7 +6,7 @@ jobs: build: strategy: matrix: - ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.2', '9.2.5', '9.4.5', '9.6.1'] + ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.2', '9.2.5'] os: ['ubuntu-latest', 'macos-latest'] runs-on: ${{ matrix.os }} diff --git a/ChangeLog.md b/ChangeLog.md index 6e49214..1d96bd9 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,7 @@ ## 0.2.5.2 - 2022-07-03 * Loosen version bounds +* Support GHC 9.2 ## 0.2.5.1 - 2022-01-04 diff --git a/aeson-gadt-th.cabal b/aeson-gadt-th.cabal index be41ed7..cd2cb52 100644 --- a/aeson-gadt-th.cabal +++ b/aeson-gadt-th.cabal @@ -20,12 +20,12 @@ flag build-readme library exposed-modules: Data.Aeson.GADT.TH - build-depends: base >= 4.8 && < 4.16 + build-depends: base >= 4.8 && < 4.17 , aeson >= 1.3 && < 2.3 , containers >= 0.5 && < 0.7 , dependent-sum >= 0.4 && < 0.8 , transformers >= 0.5 && < 0.6 - , template-haskell >= 2.11.0 && < 2.18 + , template-haskell >= 2.11.0 && < 2.19 , th-abstraction >= 0.4 && < 0.5 if impl(ghc < 8.2) build-depends: dependent-sum < 0.6.2.2 diff --git a/src/Data/Aeson/GADT/TH.hs b/src/Data/Aeson/GADT/TH.hs index 2fb827a..7bf7657 100644 --- a/src/Data/Aeson/GADT/TH.hs +++ b/src/Data/Aeson/GADT/TH.hs @@ -238,7 +238,14 @@ conMatches clsName topVars ixVar c = do [InstanceD _ cxt (AppT _className (AppT (ConT _some) ityp)) _] -> do sub <- lift $ unifyTypes [ityp, tn] tellCxt $ applySubstitution sub cxt - return (ConP 'Some [VarP x], VarE x) + return ( ConP + 'Some +#if MIN_VERSION_template_haskell(2,18,0) + [] +#endif + [VarP x] + , VarE x + ) _ -> error $ "The following instances of " ++ show clsName ++ " for " ++ show (ppr [AppT (ConT ''Some) tn]) ++ " exist (rigids: " ++ unwords (map show $ Set.toList rigidVars) ++ "), and I don't know which to pick:\n" ++ unlines (map (show . ppr) insts) _ -> do demandInstanceIfNecessary