Skip to content

Commit 25f972d

Browse files
committedDec 8, 2023
Make check recognise TypeAbstractions
See haskell#9496. “Backport” of haskell#9502, notice that we are not adding a new constructor, just tweaking `check` behaviour. This is improve UX without breaking changes.
1 parent 5d97fcf commit 25f972d

File tree

6 files changed

+37
-3
lines changed

6 files changed

+37
-3
lines changed
 

‎Cabal/src/Distribution/PackageDescription/Check.hs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1193,9 +1193,10 @@ checkFields pkg =
11931193
unknownCompilers = [ name | (OtherCompiler name, _) <- testedWith pkg ]
11941194
unknownLanguages = [ name | bi <- allBuildInfo pkg
11951195
, UnknownLanguage name <- allLanguages bi ]
1196-
unknownExtensions = [ name | bi <- allBuildInfo pkg
1197-
, UnknownExtension name <- allExtensions bi
1198-
, name `notElem` map prettyShow knownLanguages ]
1196+
unknownExtensions = filter (/= "TypeAbstractions")
1197+
[ name | bi <- allBuildInfo pkg
1198+
, UnknownExtension name <- allExtensions bi
1199+
, name `notElem` map prettyShow knownLanguages ]
11991200
ourDeprecatedExtensions = nub $ catMaybes
12001201
[ find ((==ext) . fst) deprecatedExtensions
12011202
| bi <- allBuildInfo pkg
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# cabal check
2+
No errors or warnings could be found in the package.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Test.Cabal.Prelude
2+
3+
-- Uknown extension, exception for TypeAbstractions, see #9496
4+
main = cabalTest $
5+
cabal "check" []
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
cabal-version: 3.0
2+
name: pkg
3+
synopsis: synopsis
4+
description: description
5+
version: 0
6+
category: example
7+
maintainer: none@example.com
8+
license: GPL-3.0-or-later
9+
10+
library
11+
exposed-modules: Module
12+
default-language: Haskell2010
13+
default-extensions: TypeAbstractions

‎changelog.d/pr-9503

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
synopsis: Make `check` recognise `TypeAbstractions`
2+
packages: cabal-install
3+
prs: #9503
4+
issues: #9496
5+
6+
description: {
7+
8+
- `cabal check` will not complain about “Unknown extension” when
9+
finding `TypeAbstractions`.
10+
11+
}

‎editors/vim/syntax/cabal.vim

+2
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ syn keyword cabalExtension contained
267267
\ TraditionalRecordSyntax
268268
\ TransformListComp
269269
\ TupleSections
270+
\ TypeAbstractions
270271
\ TypeApplications
271272
\ TypeData
272273
\ TypeFamilies
@@ -405,6 +406,7 @@ syn keyword cabalExtension contained
405406
\ NoTraditionalRecordSyntax
406407
\ NoTransformListComp
407408
\ NoTupleSections
409+
\ NoTypeAbstractions
408410
\ NoTypeApplications
409411
\ NoTypeFamilies
410412
\ NoTypeFamilyDependencies

0 commit comments

Comments
 (0)
Please sign in to comment.