summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/pmcheck/complete_sigs/T14422.stderr4
-rw-r--r--testsuite/tests/pmcheck/complete_sigs/T19475.hs19
-rw-r--r--testsuite/tests/pmcheck/complete_sigs/T19475.stderr4
-rw-r--r--testsuite/tests/pmcheck/complete_sigs/all.T1
4 files changed, 26 insertions, 2 deletions
diff --git a/testsuite/tests/pmcheck/complete_sigs/T14422.stderr b/testsuite/tests/pmcheck/complete_sigs/T14422.stderr
index 26a03573ae..564233a189 100644
--- a/testsuite/tests/pmcheck/complete_sigs/T14422.stderr
+++ b/testsuite/tests/pmcheck/complete_sigs/T14422.stderr
@@ -1,8 +1,8 @@
T14422.hs:31:1: warning: [-Wincomplete-patterns (in -Wextra)]
Pattern match(es) are non-exhaustive
- In an equation for ‘g’: Patterns of type ‘f a’ not matched: P
+ In an equation for ‘g’: Patterns of type ‘f a’ not matched: _
T14422.hs:44:1: warning: [-Wincomplete-patterns (in -Wextra)]
Pattern match(es) are non-exhaustive
- In an equation for ‘i’: Patterns of type ‘f a’ not matched: P
+ In an equation for ‘i’: Patterns of type ‘f a’ not matched: _
diff --git a/testsuite/tests/pmcheck/complete_sigs/T19475.hs b/testsuite/tests/pmcheck/complete_sigs/T19475.hs
new file mode 100644
index 0000000000..beb63e6745
--- /dev/null
+++ b/testsuite/tests/pmcheck/complete_sigs/T19475.hs
@@ -0,0 +1,19 @@
+{-# OPTIONS_GHC -Wincomplete-patterns -fforce-recomp #-}
+{-# LANGUAGE PatternSynonyms #-}
+{-# LANGUAGE ViewPatterns #-}
+
+module T19475 where
+
+class C f where
+ foo :: f a -> ()
+pattern P :: C f => f a
+pattern P <- (foo -> ())
+{-# COMPLETE P #-}
+
+class D f where
+ bar :: f a -> ()
+pattern Q :: D f => f a
+pattern Q <- (bar -> ())
+
+g :: D f => f a -> ()
+g Q = () -- Warning should not suggest P!
diff --git a/testsuite/tests/pmcheck/complete_sigs/T19475.stderr b/testsuite/tests/pmcheck/complete_sigs/T19475.stderr
new file mode 100644
index 0000000000..035f80475a
--- /dev/null
+++ b/testsuite/tests/pmcheck/complete_sigs/T19475.stderr
@@ -0,0 +1,4 @@
+
+T19475.hs:19:1: warning: [-Wincomplete-patterns (in -Wextra)]
+ Pattern match(es) are non-exhaustive
+ In an equation for ‘g’: Patterns of type ‘f a’ not matched: _
diff --git a/testsuite/tests/pmcheck/complete_sigs/all.T b/testsuite/tests/pmcheck/complete_sigs/all.T
index 49ed3c62bc..06bbf017b3 100644
--- a/testsuite/tests/pmcheck/complete_sigs/all.T
+++ b/testsuite/tests/pmcheck/complete_sigs/all.T
@@ -28,3 +28,4 @@ test('T17386', normal, compile, [''])
test('T18277', normal, compile, [''])
test('T18960', normal, compile, [''])
test('T18960b', normal, compile, [''])
+test('T19475', normal, compile, [''])