summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T12646.hs
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2016-12-09 08:50:54 -0500
committerRyan Scott <ryan.gl.scott@gmail.com>2016-12-09 08:50:54 -0500
commitf65ff2c4c9b60e370a722ac7572186816e23e573 (patch)
treecb8e7f56d8ddf048cf75f98b0e085600c5e6df39 /testsuite/tests/th/T12646.hs
parent6da62535469149d69ec98674db1c51dbde0efab1 (diff)
downloadhaskell-f65ff2c4c9b60e370a722ac7572186816e23e573.tar.gz
Disambiguate reified closed type family kinds in TH
Summary: A continuation of #8953. This fixes an oversight in which the left-hand sides of closed type families, when reified in Template Haskell, would not be given kind annotations, even when they are necessary for disambiguation purposes in the presence of `PolyKinds`. Fixes #8953 and #12646. Test Plan: ./validate Reviewers: hvr, bgamari, austin, goldfire Reviewed By: goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2795 GHC Trac Issues: #8953, #12646
Diffstat (limited to 'testsuite/tests/th/T12646.hs')
-rw-r--r--testsuite/tests/th/T12646.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/th/T12646.hs b/testsuite/tests/th/T12646.hs
new file mode 100644
index 0000000000..197d59e67b
--- /dev/null
+++ b/testsuite/tests/th/T12646.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeFamilies #-}
+module T12646 where
+
+import Language.Haskell.TH
+import System.IO
+
+type family F (a :: k) :: * where
+ F (a :: * -> *) = Int
+ F (a :: k) = Char
+
+$(do info <- reify ''F
+ runIO $ putStrLn $ pprint info
+ runIO $ hFlush stdout
+ return [])