summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-05-08 14:04:34 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2017-05-09 10:43:54 +0100
commit549c8b33da25371ab1aa1818ef27fc418252e667 (patch)
tree5530e7c2152e113965c641f9a32dd9c21e2dc44b /testsuite/tests/rename
parentd46a5102e0911e96a85434e46bbfe8b9ccc86471 (diff)
downloadhaskell-549c8b33da25371ab1aa1818ef27fc418252e667.tar.gz
Don't warn about variable-free strict pattern bindings
See Trac #13646 and the new Note [Pattern bindings that bind no variables]
Diffstat (limited to 'testsuite/tests/rename')
-rw-r--r--testsuite/tests/rename/should_compile/T13646.hs15
-rw-r--r--testsuite/tests/rename/should_compile/T13646.stderr3
-rw-r--r--testsuite/tests/rename/should_compile/all.T3
3 files changed, 20 insertions, 1 deletions
diff --git a/testsuite/tests/rename/should_compile/T13646.hs b/testsuite/tests/rename/should_compile/T13646.hs
new file mode 100644
index 0000000000..d2d82797ae
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T13646.hs
@@ -0,0 +1,15 @@
+{-# OPTIONS_GHC -Wall #-}
+{-# LANGUAGE BangPatterns #-}
+
+module T13646 where
+
+import Control.Exception
+
+foo :: IO ()
+foo = do let !() = assert False ()
+ -- Should not give a warning
+
+ let () = assert False ()
+ -- Should give a warning
+
+ pure ()
diff --git a/testsuite/tests/rename/should_compile/T13646.stderr b/testsuite/tests/rename/should_compile/T13646.stderr
new file mode 100644
index 0000000000..ad23c444c9
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T13646.stderr
@@ -0,0 +1,3 @@
+
+T13646.hs:12:14: warning: [-Wunused-pattern-binds (in -Wextra, -Wunused-binds)]
+ This pattern-binding binds no variables: () = assert False ()
diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T
index f6b71fda3b..e7ad719278 100644
--- a/testsuite/tests/rename/should_compile/all.T
+++ b/testsuite/tests/rename/should_compile/all.T
@@ -27,7 +27,7 @@ test('rn034', normal, compile, [''])
test('rn035', normal, compile, [''])
test('rn036', normal, compile, [''])
test('rn037', normal, compile, [''])
-
+
# Missing:
# test('rn038', normal, compile, [''])
@@ -150,3 +150,4 @@ test('T12533', normal, compile, [''])
test('T12597', normal, compile, [''])
test('T12548', normal, compile, [''])
test('T13132', normal, compile, [''])
+test('T13646', normal, compile, [''])