summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2014-11-04 10:37:38 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2014-11-04 10:38:09 +0000
commitfe178b2729bb044b401b3fe670d12bcd3d14ad71 (patch)
treea80c3c5876693260320aae95693e0d060963ec39
parent09aac7dafc2905603283b6028e4ce7416716bcd6 (diff)
downloadhaskell-fe178b2729bb044b401b3fe670d12bcd3d14ad71.tar.gz
Test Trac #9750
-rw-r--r--testsuite/tests/polykinds/T9750.hs34
-rw-r--r--testsuite/tests/polykinds/all.T1
2 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/tests/polykinds/T9750.hs b/testsuite/tests/polykinds/T9750.hs
new file mode 100644
index 0000000000..9d865d08f6
--- /dev/null
+++ b/testsuite/tests/polykinds/T9750.hs
@@ -0,0 +1,34 @@
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+
+module T9750 where
+
+import GHC.TypeLits ( Symbol, KnownSymbol )
+
+--------------------------------------------------------------------------------
+
+data Meta = MetaCons Symbol
+data M1 (c :: Meta) = M1
+
+class Generic a where
+ type Rep a :: *
+ from :: a -> Rep a
+
+--------------------------------------------------------------------------------
+
+data A = A1
+
+instance Generic A where
+ type Rep A = M1 ('MetaCons "test")
+ from A1 = M1
+
+class GShow' f where
+ gshowsPrec' :: f -> ShowS
+
+instance (KnownSymbol c) => GShow' (M1 ('MetaCons c)) where
+ gshowsPrec' = error "urk"
+
+instance GShow' A where
+ gshowsPrec' = gshowsPrec' . from
diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T
index 5b02dda80c..48b0e61b5e 100644
--- a/testsuite/tests/polykinds/all.T
+++ b/testsuite/tests/polykinds/all.T
@@ -108,3 +108,4 @@ test('T9263', normal, run_command, ['$MAKE -s --no-print-directory T9263'])
test('T9063', normal, compile, [''])
test('T9200', normal, compile, [''])
test('T9200b', normal, compile_fail, [''])
+test('T9750', normal, compile, [''])