Skip to content

Commit

Permalink
Merge pull request #9504 from ffaf1/add-extension-3.10
Browse files Browse the repository at this point in the history
Make `check` recognise `TypeAbstractions`
  • Loading branch information
mergify[bot] authored Dec 9, 2023
2 parents 5d97fcf + 25f972d commit 3f51173
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Cabal/src/Distribution/PackageDescription/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# cabal check
No errors or warnings could be found in the package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Test.Cabal.Prelude

-- Uknown extension, exception for TypeAbstractions, see #9496
main = cabalTest $
cabal "check" []
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions changelog.d/pr-9503
Original file line number Diff line number Diff line change
@@ -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`.

}
2 changes: 2 additions & 0 deletions editors/vim/syntax/cabal.vim
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ syn keyword cabalExtension contained
\ TraditionalRecordSyntax
\ TransformListComp
\ TupleSections
\ TypeAbstractions
\ TypeApplications
\ TypeData
\ TypeFamilies
Expand Down Expand Up @@ -405,6 +406,7 @@ syn keyword cabalExtension contained
\ NoTraditionalRecordSyntax
\ NoTransformListComp
\ NoTupleSections
\ NoTypeAbstractions
\ NoTypeApplications
\ NoTypeFamilies
\ NoTypeFamilyDependencies
Expand Down

0 comments on commit 3f51173

Please sign in to comment.