summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-07-12 17:50:11 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-07-12 17:50:11 +0100
commit89261ca1fb819072f849620e996ce91395cefe80 (patch)
tree039b5741c0e5bb8c67e7ad2672e8fd26cb94364e /testsuite/tests
parentaab80f88e58e67cc8e1769b0f5bffab20d20c084 (diff)
downloadhaskell-89261ca1fb819072f849620e996ce91395cefe80.tar.gz
Test Trac #7022
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/polykinds/Makefile5
-rw-r--r--testsuite/tests/polykinds/T7022.hs9
-rw-r--r--testsuite/tests/polykinds/T7022a.hs13
-rw-r--r--testsuite/tests/polykinds/all.T1
4 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/tests/polykinds/Makefile b/testsuite/tests/polykinds/Makefile
index 4ac688d458..ad57eb0621 100644
--- a/testsuite/tests/polykinds/Makefile
+++ b/testsuite/tests/polykinds/Makefile
@@ -21,3 +21,8 @@ T6054:
$(RM) -f T6054.hi T6054.o T6054a.hi T6054a.o
'$(TEST_HC)' $(TEST_HC_OPTS) -c T6054a.hs
-'$(TEST_HC)' $(TEST_HC_OPTS) -c T6054.hs
+
+T7022:
+ $(RM) -f T7022.hi T7022.o T7022a.hi T7022a.o
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c T7022a.hs
+ -'$(TEST_HC)' $(TEST_HC_OPTS) -c -v0 T7022.hs
diff --git a/testsuite/tests/polykinds/T7022.hs b/testsuite/tests/polykinds/T7022.hs
new file mode 100644
index 0000000000..a21453b6a6
--- /dev/null
+++ b/testsuite/tests/polykinds/T7022.hs
@@ -0,0 +1,9 @@
+{-# LANGUAGE PolyKinds, TypeFamilies, DataKinds, TemplateHaskell #-}
+
+module T7022 where
+
+import T7022a
+
+data family Sing (a :: k)
+
+$( makeSList )
diff --git a/testsuite/tests/polykinds/T7022a.hs b/testsuite/tests/polykinds/T7022a.hs
new file mode 100644
index 0000000000..a286fd3c1d
--- /dev/null
+++ b/testsuite/tests/polykinds/T7022a.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module T7022a where
+
+import Language.Haskell.TH
+
+makeSList :: Q [Dec]
+-- makes "type SList (a :: [k]) = Sing a"
+makeSList = do
+ a <- newName "a"
+ k <- newName "k"
+ return [TySynD (mkName "SList") [KindedTV a (AppT ListT (VarT k))]
+ (AppT (ConT (mkName "Sing")) (VarT a))]
diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T
index 079671a139..cf74a72b5e 100644
--- a/testsuite/tests/polykinds/all.T
+++ b/testsuite/tests/polykinds/all.T
@@ -57,3 +57,4 @@ test('T6129', normal, compile_fail,[''])
test('T7053', normal, compile_fail,[''])
test('T7053a', normal, compile,[''])
test('T7020', normal, compile,[''])
+test('T7022', normal, run_command, ['$MAKE -s --no-print-directory T7022'])