diff options
author | Shayne Fletcher <shayne.fletcher@digitalasset.com> | 2018-12-28 19:13:51 -0500 |
---|---|---|
committer | Ben Gamari <ben@well-typed.com> | 2018-12-28 19:13:51 -0500 |
commit | fdf11c90992762f6f6264b8d8c1678c4ddd53eb8 (patch) | |
tree | 7be9972b1b348f52390f86dddeb7f71098525ccc /testsuite/tests/rebindable | |
parent | 07022297749b8091af58a3302581ad90e9ca329b (diff) | |
download | haskell-fdf11c90992762f6f6264b8d8c1678c4ddd53eb8.tar.gz |
rebindable-clash-warning-fix : correct warning logic
Diffstat (limited to 'testsuite/tests/rebindable')
-rw-r--r-- | testsuite/tests/rebindable/all.T | 4 | ||||
-rw-r--r-- | testsuite/tests/rebindable/rebindable11.hs | 15 | ||||
-rw-r--r-- | testsuite/tests/rebindable/rebindable11.stderr | 0 | ||||
-rw-r--r-- | testsuite/tests/rebindable/rebindable12.hs | 14 | ||||
-rw-r--r-- | testsuite/tests/rebindable/rebindable12.stderr | 4 |
5 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/tests/rebindable/all.T b/testsuite/tests/rebindable/all.T index f796a38750..1484dd73d9 100644 --- a/testsuite/tests/rebindable/all.T +++ b/testsuite/tests/rebindable/all.T @@ -21,6 +21,10 @@ test('rebindable8', normal, compile, ['']) test('rebindable9', normal, compile, ['']) test('rebindable10', normal, compile_and_run, ['']) +# Test rebindable clash warnings +test('rebindable11', normal, compile, ['']) +test('rebindable12', normal, compile_fail, ['']) + test('T303', normal, compile, ['']) # Tests from Oleg diff --git a/testsuite/tests/rebindable/rebindable11.hs b/testsuite/tests/rebindable/rebindable11.hs new file mode 100644 index 0000000000..13e1b2dd3d --- /dev/null +++ b/testsuite/tests/rebindable/rebindable11.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE RebindableSyntax, MonadFailDesugaring #-} +{-# OPTIONS_GHC -Wno-missing-monadfail-instances #-} + +-- Test that rebindable clash warnings are not displayed. This program +-- should not generate anything on stderr at compile time. + +module Main where + +import Prelude + +catMaybes xs = do + Just x <- xs + return x + +main = return () diff --git a/testsuite/tests/rebindable/rebindable11.stderr b/testsuite/tests/rebindable/rebindable11.stderr new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/testsuite/tests/rebindable/rebindable11.stderr diff --git a/testsuite/tests/rebindable/rebindable12.hs b/testsuite/tests/rebindable/rebindable12.hs new file mode 100644 index 0000000000..fd2e1c7bb3 --- /dev/null +++ b/testsuite/tests/rebindable/rebindable12.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE RebindableSyntax, MonadFailDesugaring #-} +{-# OPTIONS_GHC -Wmissing-monadfail-instances #-} + +-- Test that rebindable clash warnings are displayed. + +module Main where + +import Prelude + +catMaybes xs = do + Just x <- xs + return x + +main = return () diff --git a/testsuite/tests/rebindable/rebindable12.stderr b/testsuite/tests/rebindable/rebindable12.stderr new file mode 100644 index 0000000000..722a95c293 --- /dev/null +++ b/testsuite/tests/rebindable/rebindable12.stderr @@ -0,0 +1,4 @@ +rebindable12.hs:11:5: error: [-Wmissing-monadfail-instances (in -Wcompat), -Werror=missing-monadfail-instances] + The failable pattern ‘Just x’ + is used together with -XRebindableSyntax. If this is intentional, + compile with -Wno-missing-monadfail-instances. |