Test Trac #11245
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 31 Dec 2015 14:32:27 +0000 (14:32 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 31 Dec 2015 14:44:00 +0000 (14:44 +0000)
testsuite/tests/pmcheck/should_compile/T11245.hs [new file with mode: 0644]
testsuite/tests/pmcheck/should_compile/T11245.stderr [new file with mode: 0644]
testsuite/tests/pmcheck/should_compile/all.T

diff --git a/testsuite/tests/pmcheck/should_compile/T11245.hs b/testsuite/tests/pmcheck/should_compile/T11245.hs
new file mode 100644 (file)
index 0000000..1f5c0fc
--- /dev/null
@@ -0,0 +1,13 @@
+module T11245 where
+
+
+foo x = do
+  let a | Just i <- x
+        , odd i
+        = True
+
+        | Nothing <- x
+        = False
+
+  print x
+  print a
diff --git a/testsuite/tests/pmcheck/should_compile/T11245.stderr b/testsuite/tests/pmcheck/should_compile/T11245.stderr
new file mode 100644 (file)
index 0000000..184029a
--- /dev/null
@@ -0,0 +1,4 @@
+\r
+T11245.hs:5:7: warning:\r
+    Pattern match(es) are non-exhaustive\r
+    In an equation for ‘a’: Guards do not cover entire pattern space\r
index 9278fde..292e9af 100644 (file)
@@ -32,3 +32,4 @@ test('pmc004', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patter
 test('pmc005', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
 test('pmc006', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
 test('pmc007', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
+test('T11245', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])