summaryrefslogtreecommitdiff
path: root/testsuite/tests/patsyn
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2017-07-31 22:33:40 -0400
committerBen Gamari <ben@smart-cactus.org>2017-08-01 08:57:15 -0400
commit29f07b1de78198fa29dabafd7bf1f1f4ecdc7f54 (patch)
treef93ca831f2dfa35e99ae98b03bc4c6952098bdb8 /testsuite/tests/patsyn
parent5a7af95ad2ce38e4b80893d869948c630454683b (diff)
downloadhaskell-29f07b1de78198fa29dabafd7bf1f1f4ecdc7f54.tar.gz
Allow bundling pattern synonyms with exported data families
Test Plan: make test TEST=T14058 Reviewers: mpickering, austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie GHC Trac Issues: #14058 Differential Revision: https://phabricator.haskell.org/D3808
Diffstat (limited to 'testsuite/tests/patsyn')
-rw-r--r--testsuite/tests/patsyn/should_compile/T14058.hs7
-rw-r--r--testsuite/tests/patsyn/should_compile/T14058a.hs19
-rw-r--r--testsuite/tests/patsyn/should_compile/all.T2
3 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/tests/patsyn/should_compile/T14058.hs b/testsuite/tests/patsyn/should_compile/T14058.hs
new file mode 100644
index 0000000000..7c263b8f44
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T14058.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE TypeInType #-}
+module T14058 where
+
+import T14058a (Sing(..))
+
+foo :: Sing ('[ '[] ] :: [[a]])
+foo = SCons SNil SNil
diff --git a/testsuite/tests/patsyn/should_compile/T14058a.hs b/testsuite/tests/patsyn/should_compile/T14058a.hs
new file mode 100644
index 0000000000..a7e5d97b79
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T14058a.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE PatternSynonyms #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE TypeInType #-}
+{-# LANGUAGE TypeOperators #-}
+module T14058a (Sing(.., SCons)) where
+
+data family Sing (a :: k)
+
+data instance Sing (z :: [a]) where
+ SNil :: Sing '[]
+ (:%) :: Sing x -> Sing xs -> Sing (x:xs)
+
+pattern SCons :: forall a (z :: [a]). ()
+ => forall (x :: a) (xs :: [a]). z ~ (x:xs)
+ => Sing x -> Sing xs -> Sing z
+pattern SCons x xs = (:%) x xs
+{-# COMPLETE SNil, SCons #-}
diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T
index 286f735ac6..b8c9806694 100644
--- a/testsuite/tests/patsyn/should_compile/all.T
+++ b/testsuite/tests/patsyn/should_compile/all.T
@@ -71,3 +71,5 @@ test('T13454', normal, compile, [''])
test('T13752', normal, compile, [''])
test('T13752a', normal, compile, [''])
test('T13768', normal, compile, [''])
+test('T14058', [extra_files(['T14058.hs', 'T14058a.hs'])],
+ multimod_compile, ['T14058', '-v0'])