summaryrefslogtreecommitdiff
path: root/tests/examples/ghc86/T10891.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/examples/ghc86/T10891.hs')
-rw-r--r--tests/examples/ghc86/T10891.hs41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/examples/ghc86/T10891.hs b/tests/examples/ghc86/T10891.hs
new file mode 100644
index 0000000..aff4e88
--- /dev/null
+++ b/tests/examples/ghc86/T10891.hs
@@ -0,0 +1,41 @@
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE TemplateHaskell #-}
+
+module T10891 where
+
+import Language.Haskell.TH
+import System.IO
+
+class C a where
+ f :: a -> Int
+
+class C' a where
+ type F a :: *
+ type F a = a
+ f' :: a -> Int
+
+class C'' a where
+ data Fd a :: *
+
+instance C' Int where
+ type F Int = Bool
+ f' = id
+
+instance C'' Int where
+ data Fd Int = B Bool | C Char
+
+$(return [])
+
+test :: ()
+test =
+ $(let
+ display :: Name -> Q ()
+ display q = do
+ i <- reify q
+ runIO (hPutStrLn stderr (pprint i) >> hFlush stderr)
+ in do
+ display ''C
+ display ''C'
+ display ''C''
+ [| () |])
+