summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2019-05-29 12:48:50 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-05-31 02:01:18 -0400
commite32786dfc9290e037f70cd942d5922217f2ab7cc (patch)
tree1091f076514d1aa34478b5ffa0e448c8fb36a86d /testsuite/tests
parentbb929009523a20271e1af34990e5c85d440de0d7 (diff)
downloadhaskell-e32786dfc9290e037f70cd942d5922217f2ab7cc.tar.gz
Put COMPLETE sigs into ModDetails with -fno-code (#16682)
`mkBootModDetailsTc`, which creates a special `ModDetails` when `-fno-code` is enabled, was not properly filling in the `COMPLETE` signatures from the `TcGblEnv`, resulting in incorrect pattern-match coverage warnings. Easily fixed. Fixes #16682.
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/patsyn/should_compile/T16682.hs5
-rw-r--r--testsuite/tests/patsyn/should_compile/T16682a.hs8
-rw-r--r--testsuite/tests/patsyn/should_compile/all.T2
3 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/patsyn/should_compile/T16682.hs b/testsuite/tests/patsyn/should_compile/T16682.hs
new file mode 100644
index 0000000000..1a8e540f99
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T16682.hs
@@ -0,0 +1,5 @@
+module T16682 where
+
+import T16682a
+
+f Unit = () -- Non-exhaustive patterns warning with -fno-code
diff --git a/testsuite/tests/patsyn/should_compile/T16682a.hs b/testsuite/tests/patsyn/should_compile/T16682a.hs
new file mode 100644
index 0000000000..f77bd8203a
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T16682a.hs
@@ -0,0 +1,8 @@
+{-# language PatternSynonyms #-}
+module T16682a where
+
+pattern Unit = ()
+
+{-# complete Unit #-}
+
+f Unit = () -- No warnings
diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T
index 6eb9e2db8a..2ac343f635 100644
--- a/testsuite/tests/patsyn/should_compile/all.T
+++ b/testsuite/tests/patsyn/should_compile/all.T
@@ -77,3 +77,5 @@ test('T14326', normal, compile, [''])
test('T14394', normal, ghci_script, ['T14394.script'])
test('T14552', normal, compile, [''])
test('T14498', normal, compile, [''])
+test('T16682', [extra_files(['T16682.hs', 'T16682a.hs'])],
+ multimod_compile, ['T16682', '-v0 -fwarn-incomplete-patterns -fno-code'])