diff --git a/Cabal/src/Distribution/PackageDescription/Check.hs b/Cabal/src/Distribution/PackageDescription/Check.hs index 166d53e0290..63ea09736f4 100644 --- a/Cabal/src/Distribution/PackageDescription/Check.hs +++ b/Cabal/src/Distribution/PackageDescription/Check.hs @@ -1193,9 +1193,10 @@ checkFields pkg = unknownCompilers = [ name | (OtherCompiler name, _) <- testedWith pkg ] unknownLanguages = [ name | bi <- allBuildInfo pkg , UnknownLanguage name <- allLanguages bi ] - unknownExtensions = [ name | bi <- allBuildInfo pkg - , UnknownExtension name <- allExtensions bi - , name `notElem` map prettyShow knownLanguages ] + unknownExtensions = filter (/= "TypeAbstractions") + [ name | bi <- allBuildInfo pkg + , UnknownExtension name <- allExtensions bi + , name `notElem` map prettyShow knownLanguages ] ourDeprecatedExtensions = nub $ catMaybes [ find ((==ext) . fst) deprecatedExtensions | bi <- allBuildInfo pkg diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/cabal.out new file mode 100644 index 00000000000..37aa169b416 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/cabal.out @@ -0,0 +1,2 @@ +# cabal check +No errors or warnings could be found in the package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/cabal.test.hs b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/cabal.test.hs new file mode 100644 index 00000000000..5865ce8893a --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/cabal.test.hs @@ -0,0 +1,5 @@ +import Test.Cabal.Prelude + +-- Uknown extension, exception for TypeAbstractions, see #9496 +main = cabalTest $ + cabal "check" [] diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/pkg.cabal b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/pkg.cabal new file mode 100644 index 00000000000..10a8974db90 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/KnownTypeAbstractions/pkg.cabal @@ -0,0 +1,13 @@ +cabal-version: 3.0 +name: pkg +synopsis: synopsis +description: description +version: 0 +category: example +maintainer: none@example.com +license: GPL-3.0-or-later + +library + exposed-modules: Module + default-language: Haskell2010 + default-extensions: TypeAbstractions diff --git a/changelog.d/pr-9503 b/changelog.d/pr-9503 new file mode 100644 index 00000000000..d53e09fae9e --- /dev/null +++ b/changelog.d/pr-9503 @@ -0,0 +1,11 @@ +synopsis: Make `check` recognise `TypeAbstractions` +packages: cabal-install +prs: #9503 +issues: #9496 + +description: { + +- `cabal check` will not complain about “Unknown extension” when + finding `TypeAbstractions`. + +} diff --git a/editors/vim/syntax/cabal.vim b/editors/vim/syntax/cabal.vim index 1fc84f4d8af..fa52f12a168 100644 --- a/editors/vim/syntax/cabal.vim +++ b/editors/vim/syntax/cabal.vim @@ -267,6 +267,7 @@ syn keyword cabalExtension contained \ TraditionalRecordSyntax \ TransformListComp \ TupleSections + \ TypeAbstractions \ TypeApplications \ TypeData \ TypeFamilies @@ -405,6 +406,7 @@ syn keyword cabalExtension contained \ NoTraditionalRecordSyntax \ NoTransformListComp \ NoTupleSections + \ NoTypeAbstractions \ NoTypeApplications \ NoTypeFamilies \ NoTypeFamilyDependencies