diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2015-12-06 16:08:21 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2015-12-06 16:39:00 +0100 |
commit | 986ceb1679b501414b996c520b08ce929a40f94c (patch) | |
tree | acb181dddedd41e6c8927f814430eab92b88ff78 /testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr | |
parent | df6794035f1e4397d89896f329525e5368b7d1cc (diff) | |
download | haskell-986ceb1679b501414b996c520b08ce929a40f94c.tar.gz |
Implement new `-fwarn-noncanonical-monoid-instances`
This is similiar to the `-fwarn-noncanonical-monad-instances` warning
implemented via #11128, but applies to `Semigroup`/`Monoid` instead
and the `(<>)`/`mappend` methods (of which `mappend` is planned to move
out of `Monoid` at some point in the future being redundant and thus
error-prone).
This warning is contained in `-Wcompat` but not in `-Wall`.
This addresses #11150
Reviewed By: quchen
Differential Revision: https://phabricator.haskell.org/D1553
Diffstat (limited to 'testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr')
-rw-r--r-- | testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr b/testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr index 7b6b501708..5de8745544 100644 --- a/testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr +++ b/testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr @@ -1,12 +1,12 @@ -WCompatWarningsOn.hs:11:5: warning: +WCompatWarningsOn.hs:13:5: warning: • Could not deduce (MonadFail m) arising from the failable pattern ‘Just _’ (this will become an error a future GHC release) from the context: Monad m bound by the type signature for: monadFail :: Monad m => m a - at WCompatWarningsOn.hs:9:1-27 + at WCompatWarningsOn.hs:11:1-27 Possible fix: add (MonadFail m) to the context of the type signature for: @@ -20,6 +20,16 @@ WCompatWarningsOn.hs:11:5: warning: = do { Just _ <- undefined; undefined } -WCompatWarningsOn.hs:14:1: warning: +WCompatWarningsOn.hs:16:1: warning: Local definition of ‘<>’ clashes with a future Prelude name. This will become an error in a future release. + +WCompatWarningsOn.hs:22:3: warning: + Noncanonical ‘(<>) = mappend’ definition detected + in the instance declaration for ‘Semigroup S’. + Move definition from ‘mappend’ to ‘(<>)’ + +WCompatWarningsOn.hs:25:3: warning: + Noncanonical ‘mappend’ definition detected + in the instance declaration for ‘Monoid S’. + Define as ‘mappend = (<>)’ |