Skip to content

Commit

Permalink
Registered the NamedDefaults language extension (#9740)
Browse files Browse the repository at this point in the history
* Registered the NamedDefaults language extension

* Added changelog and Vim configuration lines

* Updated the expected hashes

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
blamario and mergify[bot] committed Apr 12, 2024
1 parent 8e971f5 commit 00835c0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Cabal-syntax/src/Language/Haskell/Extension.hs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ data KnownExtension
| -- | Allow default instantiation of polymorphic types in more
-- situations.
ExtendedDefaultRules
| -- | Allow @default@ declarations to explicitly name the class and
-- be exported.
NamedDefaults
| -- | Enable unboxed tuples.
UnboxedTuples
| -- | Enable @deriving@ for classes 'Data.Typeable.Typeable' and
Expand Down
8 changes: 4 additions & 4 deletions Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ md5Check proxy md5Int = structureHash proxy @?= md5FromInteger md5Int
md5CheckGenericPackageDescription :: Proxy GenericPackageDescription -> Assertion
md5CheckGenericPackageDescription proxy = md5Check proxy
#if MIN_VERSION_base(4,19,0)
0x5a48c6570cbcf96af4c51f38962e37b5
0x6639f65b143830a97e9c4f448b9cabb0
#else
0xc5c0e54b95e651216e92db04c9cd4ecf
0x855933700dccfbcc1d642e3470c3702c
#endif

md5CheckLocalBuildInfo :: Proxy LocalBuildInfo -> Assertion
md5CheckLocalBuildInfo proxy = md5Check proxy
#if MIN_VERSION_base(4,19,0)
0x6d668de33d7b4d5df3830e65e6941373
0x2ae73730f60c7c947e2cb63c4aac1e54
#else
0xcdf740970a7d37e5e7ca48ea5f4f25eb7
0x906cbfdef0bcdfe5734499cfabc615f5
#endif
9 changes: 9 additions & 0 deletions changelog.d/pr-9740
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
synopsis: Add language extension NamedDefaults
packages: Cabal-syntax
prs: #9740

description: {

- adds support for the `NamedDefaults` language extension (GHC proposal #409)

}
2 changes: 2 additions & 0 deletions editors/vim/syntax/cabal.vim
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ syn keyword cabalExtension contained
\ MultiParamTypeClasses
\ MultiWayIf
\ NPlusKPatterns
\ NamedDefaults
\ NamedFieldPuns
\ NamedWildCards
\ NegativeLiterals
Expand Down Expand Up @@ -362,6 +363,7 @@ syn keyword cabalExtension contained
\ NoMultiParamTypeClasses
\ NoMultiWayIf
\ NoNPlusKPatterns
\ NoNamedDefaults
\ NoNamedFieldPuns
\ NoNamedWildCards
\ NoNegativeLiterals
Expand Down

0 comments on commit 00835c0

Please sign in to comment.