[commit: ghc] wip/T8584: Add test cases (aa85919)

git at git.haskell.org git at git.haskell.org
Sat Nov 8 03:53:35 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T8584
Link       : http://ghc.haskell.org/trac/ghc/changeset/aa859198c8955489b515db94ee69e3fda0159b93/ghc

>---------------------------------------------------------------

commit aa859198c8955489b515db94ee69e3fda0159b93
Author: Dr. ERDI Gergo <gergo at erdi.hu>
Date:   Sun Nov 2 14:35:49 2014 +0800

    Add test cases


>---------------------------------------------------------------

aa859198c8955489b515db94ee69e3fda0159b93
 testsuite/tests/patsyn/should_compile/T8584-1.hs | 10 ++++++++++
 testsuite/tests/patsyn/should_compile/T8968-1.hs |  8 ++++++++
 testsuite/tests/patsyn/should_compile/all.T      |  2 ++
 3 files changed, 20 insertions(+)

diff --git a/testsuite/tests/patsyn/should_compile/T8584-1.hs b/testsuite/tests/patsyn/should_compile/T8584-1.hs
new file mode 100644
index 0000000..7a017c8
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T8584-1.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE PatternSynonyms #-}
+module ShouldCompile where
+
+pattern type (Eq a) => Single a :: (Show a) => [a]
+-- pattern type Single a :: (Eq a, Show a) => [a]
+-- pattern type Single a :: [a]
+pattern Single x = [x]
+
+-- f :: (Show a) => [a] -> a
+foobar (Single x) = x
diff --git a/testsuite/tests/patsyn/should_compile/T8968-1.hs b/testsuite/tests/patsyn/should_compile/T8968-1.hs
new file mode 100644
index 0000000..f4a1dc4
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T8968-1.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE GADTs, KindSignatures, PatternSynonyms #-}
+module ShouldCompile where
+
+data X :: (* -> *) -> * -> * where
+  Y :: f a -> X f (Maybe a)
+
+pattern type C a :: X Maybe (Maybe a)
+pattern C x = Y (Just x)
diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T
index d851bc3..8896008 100644
--- a/testsuite/tests/patsyn/should_compile/all.T
+++ b/testsuite/tests/patsyn/should_compile/all.T
@@ -10,3 +10,5 @@ test('incomplete', normal, compile, [''])
 test('export', normal, compile, [''])
 test('T8966', normal, compile, [''])
 test('T9023', normal, compile, [''])
+test('T8968-1', normal, compile, [''])
+test('T8584-1', normal, compile, [''])



More information about the ghc-commits mailing list