[commit: ghc] master: Add regression test for #14326 (429fafb)
git at git.haskell.org
git at git.haskell.org
Thu Oct 5 19:48:41 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/429fafb5b2b1ac02fd04d9a98e30b5991125692c/ghc
>---------------------------------------------------------------
commit 429fafb5b2b1ac02fd04d9a98e30b5991125692c
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date: Thu Oct 5 15:46:05 2017 -0400
Add regression test for #14326
Commit 6b77914cd37b697354611bcd87897885c1e5b4a6 wound up
fixing #14326. Let's add a regression test so that it stays
that way.
>---------------------------------------------------------------
429fafb5b2b1ac02fd04d9a98e30b5991125692c
testsuite/tests/patsyn/should_compile/T14326.hs | 21 +++++++++++++++++++++
testsuite/tests/patsyn/should_compile/all.T | 1 +
2 files changed, 22 insertions(+)
diff --git a/testsuite/tests/patsyn/should_compile/T14326.hs b/testsuite/tests/patsyn/should_compile/T14326.hs
new file mode 100644
index 0000000..59a1eb4
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T14326.hs
@@ -0,0 +1,21 @@
+{-# LANGUAGE PatternSynonyms #-}
+{-# LANGUAGE ExplicitForAll #-}
+{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
+module T14326 where
+
+data E a b = L' a | R b
+pattern L :: forall b a. a -> E a b
+pattern L a = L' a
+{-# COMPLETE L, R #-}
+
+testMono :: E (E Int Int) Int -> Int
+testMono x = case x of
+ L (L _) -> 0
+ L (R _) -> 1
+ R _ -> 2
+
+testPoly :: E (E a b) c -> Int
+testPoly x = case x of
+ L (L _) -> 0
+ L (R _) -> 1
+ R _ -> 2
diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T
index b8c9806..8bc9dbd 100644
--- a/testsuite/tests/patsyn/should_compile/all.T
+++ b/testsuite/tests/patsyn/should_compile/all.T
@@ -73,3 +73,4 @@ test('T13752a', normal, compile, [''])
test('T13768', normal, compile, [''])
test('T14058', [extra_files(['T14058.hs', 'T14058a.hs'])],
multimod_compile, ['T14058', '-v0'])
+test('T14326', normal, compile, [''])
More information about the ghc-commits
mailing list