Skip to content

Commit

Permalink
Fix #112 with support for GHC 9.8 (#113)
Browse files Browse the repository at this point in the history
* Add missing signature for overloaded `withEpAnnNotUsed`

* Fixed issued caused by #112

* Stack support for GHC 9.8

* Add stack-9.8.yaml

* Bump Tasty to `< 1.6`
  • Loading branch information
mattapet authored Apr 1, 2024
1 parent 26256ea commit d970700
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ghc-source-gen.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test-suite name_test
, base >=4.7 && <5
, ghc >=8.4 && <9.9
, ghc-source-gen
, tasty >=1.0 && <1.5
, tasty >=1.0 && <1.6
, tasty-hunit ==0.10.*
, tasty-quickcheck >=0.9 && <0.11
default-language: Haskell2010
Expand All @@ -128,7 +128,7 @@ test-suite pprint_examples
, ghc >=8.4 && <9.9
, ghc-paths ==0.1.*
, ghc-source-gen
, tasty >=1.0 && <1.5
, tasty >=1.0 && <1.6
, tasty-hunit ==0.10.*
default-language: Haskell2010
if impl(ghc<9.0)
Expand All @@ -154,7 +154,7 @@ test-suite pprint_test
, ghc >=8.4 && <9.9
, ghc-paths ==0.1.*
, ghc-source-gen
, tasty >=1.0 && <1.5
, tasty >=1.0 && <1.6
, tasty-hunit ==0.10.*
default-language: Haskell2010
if impl(ghc<9.0)
Expand Down
8 changes: 4 additions & 4 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ description: |
dependencies:
- base >= 4.7 && < 5
- ghc >= 8.4 && < 9.7
- ghc >= 8.4 && < 9.9

default-extensions:
- DataKinds
Expand Down Expand Up @@ -84,7 +84,7 @@ tests:
dependencies:
- ghc-source-gen
- ghc-paths == 0.1.*
- tasty >= 1.0 && < 1.5
- tasty >= 1.0 && < 1.6
- tasty-hunit == 0.10.*

when:
Expand All @@ -100,7 +100,7 @@ tests:
dependencies:
- ghc-source-gen
- ghc-paths == 0.1.*
- tasty >= 1.0 && < 1.5
- tasty >= 1.0 && < 1.6
- tasty-hunit == 0.10.*

when:
Expand All @@ -117,6 +117,6 @@ tests:
dependencies:
- ghc-source-gen
- QuickCheck >= 2.10 && < 2.15
- tasty >= 1.0 && < 1.5
- tasty >= 1.0 && < 1.6
- tasty-hunit == 0.10.*
- tasty-quickcheck >= 0.9 && < 0.11
9 changes: 9 additions & 0 deletions src/GHC/SourceGen/Module.hs
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,14 @@ moduleContents = withEpAnnNotUsed' IEModuleContents . mkLocated . unModuleNameSt
withEpAnnNotUsed' :: ((Maybe x, EpAnn ann) -> a) -> a
withEpAnnNotUsed' = ($ (Nothing, EpAnnNotUsed))
#else

#if MIN_VERSION_ghc(9,2,0)
withEpAnnNotUsed' :: (EpAnn ann -> a) -> a
#elif MIN_VERSION_ghc(8,6,0)
withEpAnnNotUsed' :: (NoExtField -> a) -> a
#else
withEpAnnNotUsed' :: a -> a
#endif
withEpAnnNotUsed' = withEpAnnNotUsed

#endif
15 changes: 15 additions & 0 deletions stack-9.8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2019 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

resolver: nightly-2024-03-29
compiler: ghc-9.8.2

packages:
- .
- ghc-show-ast

ghc-options:
"$locals": -Wall -Werror -Wwarn=unused-imports -Wwarn=dodgy-imports

0 comments on commit d970700

Please sign in to comment.