Skip to content

Commit ec804e4

Browse files
authored
Merge of #11990
2 parents e092cdb + 64fb5f8 commit ec804e4

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

.github/workflows/validate.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ jobs:
230230
# one possibly nightmarish final conditional. 'fail-fast' gets us
231231
# partway there, at least, but is still imperfect.
232232

233+
- name: Check that language extensions are registered for this GHC version
234+
run: cabal run ghc-supported-extensions ghc
235+
233236
validate-old-ghcs:
234237
name: Validate old ghcs ${{ matrix.extra-ghc }}
235238
# latest/latest doesn't have the old packages the old ghcs depend on

Cabal-tests/exes/GhcSupportedExtensions.hs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import Distribution.Text (display, simpleParse)
1111
import Distribution.Verbosity (Verbosity (..), defaultVerbosityHandles, normal)
1212
import Language.Haskell.Extension (Extension (..), knownLanguages)
1313

14-
import Data.List ((\\))
1514
import System.Environment (getArgs, getProgName)
1615

1716
-- | Language editions as Extensions.
@@ -61,11 +60,8 @@ checkProblems implemented =
6160
-- Extensions that ghc knows about but that are not registered except for the known languages.
6261
let unregistered = [ext | ext <- implemented, not (registered ext), ext `notElem` langsAsExts]
6362

64-
-- check if someone has forgotten to update the `langsAsExts` exceptions list...
65-
badExceptions = langsAsExts \\ implemented
66-
6763
-- exceptions that are now registered
68-
badExceptions' = filter registered langsAsExts
64+
badExceptions = filter registered langsAsExts
6965
in catMaybes
7066
[ check unregistered $
7167
unlines
@@ -75,19 +71,11 @@ checkProblems implemented =
7571
, "All extensions should be registered, even experimental extensions."
7672
]
7773
, check badExceptions $
78-
unlines
79-
[ "Error in the extension exception list. The following extensions"
80-
, "are listed as exceptions but are not even implemented by GHC:"
81-
, " " ++ intercalate "\n " (map display badExceptions)
82-
, "Please fix this test program by correcting the list of"
83-
, "exceptions."
84-
]
85-
, check badExceptions' $
8674
unlines
8775
[ "Error in the extension exception list. The following extensions"
8876
, "are listed as exceptions to registration but they are in fact"
8977
, "now registered in Language.Haskell.Extension:"
90-
, " " ++ intercalate "\n " (map display badExceptions')
78+
, " " ++ intercalate "\n " (map display badExceptions)
9179
, "Please fix this test program by correcting the list of"
9280
, "exceptions."
9381
]

0 commit comments

Comments
 (0)