From e2b08ec96aaacb66fcb6baa591e13b9bcc1a384b Mon Sep 17 00:00:00 2001 From: Krzysztof Gogolewski Date: Mon, 28 Jun 2021 22:31:35 +0200 Subject: Add a regression test for #17697 --- testsuite/tests/printer/T17697.hs | 7 +++++++ testsuite/tests/printer/T17697.stderr | 7 +++++++ testsuite/tests/printer/all.T | 1 + 3 files changed, 15 insertions(+) create mode 100644 testsuite/tests/printer/T17697.hs create mode 100644 testsuite/tests/printer/T17697.stderr 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']) -- cgit v1.2.1