diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-06-28 22:31:35 +0200 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-07-23 15:17:55 +0200 |
commit | e2b08ec96aaacb66fcb6baa591e13b9bcc1a384b (patch) | |
tree | 41b6201449c34d2ddb7819b85ae7b577378a835a | |
parent | 8ac4ca61bde1ba3e21e42e93383344ac79bd01dc (diff) | |
download | haskell-e2b08ec96aaacb66fcb6baa591e13b9bcc1a384b.tar.gz |
Add a regression test for #17697
-rw-r--r-- | testsuite/tests/printer/T17697.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/printer/T17697.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/printer/all.T | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/printer/T17697.hs b/testsuite/tests/printer/T17697.hs new file mode 100644 index 0000000000..a7fe4feedb --- /dev/null +++ b/testsuite/tests/printer/T17697.hs @@ -0,0 +1,7 @@ +{-# OPTIONS_GHC -Wunused-do-bind -fdefer-out-of-scope-variables #-} +module T17697 where + +main :: IO () +main = do + threadDelay 1 + return () diff --git a/testsuite/tests/printer/T17697.stderr b/testsuite/tests/printer/T17697.stderr new file mode 100644 index 0000000000..cdd9e7fc29 --- /dev/null +++ b/testsuite/tests/printer/T17697.stderr @@ -0,0 +1,7 @@ + +T17697.hs:6:5: warning: [-Wdeferred-out-of-scope-variables (in -Wdefault)] + Variable not in scope: threadDelay :: t0 -> IO a0 + +T17697.hs:6:5: warning: [-Wunused-do-bind (in -Wall)] + A do-notation statement discarded a result of type ‘GHC.Types.Any’ + Suggested fix: Suppress this warning by saying ‘_ <- threadDelay 1’ diff --git a/testsuite/tests/printer/all.T b/testsuite/tests/printer/all.T index 1de996cb9c..1740dd497a 100644 --- a/testsuite/tests/printer/all.T +++ b/testsuite/tests/printer/all.T @@ -68,6 +68,7 @@ test('T14306', ignore_stderr, makefile_test, ['T14306']) test('T14343', normal, compile_fail, ['']) test('T14343b', normal, compile_fail, ['']) test('T15761', normal, compile_fail, ['']) +test('T17697', normal, compile, ['']) test('T18052a', normal, compile, ['-ddump-simpl -ddump-types -dno-typeable-binds -dsuppress-uniques']) test('T18791', normal, compile, ['-ddump-parsed-ast']) |