diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2019-05-14 15:04:02 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-05-23 22:43:12 -0400 |
commit | 6eedbd83a19cad94414b37f984b6e9c2b0c0b2e4 (patch) | |
tree | f9558c084950b8879dbe2e42f2703aeb820e1071 /testsuite/tests/haddock | |
parent | 59f4cb6fb73ade6f9b0bdc85380dfddba93bf14b (diff) | |
download | haskell-6eedbd83a19cad94414b37f984b6e9c2b0c0b2e4.tar.gz |
Some forall-related cleanup in deriving code
* Tweak the parser to allow `deriving` clauses to mention explicit
`forall`s or kind signatures without gratuitous parentheses.
(This fixes #14332 as a consequence.)
* Allow Haddock comments on `deriving` clauses with explicit
`forall`s. This requires corresponding changes in Haddock.
Diffstat (limited to 'testsuite/tests/haddock')
-rw-r--r-- | testsuite/tests/haddock/should_compile_flag_haddock/T11768.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/haddock/should_compile_flag_haddock/T11768.stderr | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/T11768.hs b/testsuite/tests/haddock/should_compile_flag_haddock/T11768.hs index 5689b42380..5e7369cdc0 100644 --- a/testsuite/tests/haddock/should_compile_flag_haddock/T11768.hs +++ b/testsuite/tests/haddock/should_compile_flag_haddock/T11768.hs @@ -1,6 +1,12 @@ +{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} module T11768 where +class C a b + data Foo = Foo deriving Eq -- ^ Documenting a single type @@ -8,6 +14,7 @@ data Bar = Bar deriving ( Eq -- ^ Documenting one of multiple types , Ord ) + deriving anyclass ( forall a. C a {- ^ Documenting forall type -} ) -- | Documenting a standalone deriving instance deriving instance Read Bar diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/T11768.stderr b/testsuite/tests/haddock/should_compile_flag_haddock/T11768.stderr index 997c2ef24c..6de1b2b851 100644 --- a/testsuite/tests/haddock/should_compile_flag_haddock/T11768.stderr +++ b/testsuite/tests/haddock/should_compile_flag_haddock/T11768.stderr @@ -1,12 +1,14 @@ ==================== Parser ==================== module T11768 where +class C a b data Foo = Foo deriving Eq " Documenting a single type" data Bar = Bar deriving (Eq " Documenting one of multiple types", Ord) + deriving anyclass (forall a. C a " Documenting forall type ") <document comment> deriving instance Read Bar |