diff options
author | RyanGlScott <ryan.gl.scott@gmail.com> | 2016-04-11 02:34:55 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-04-11 02:52:18 +0200 |
commit | 02a5c580b6078630842f4c3db5d92631fada21e9 (patch) | |
tree | 72afe5bd0818e27a9e6e3d75aff6fd06518841a1 /testsuite/tests/th/T11463.hs | |
parent | 46e8f199e4d3baffa306a40082fbc2fce67f779f (diff) | |
download | haskell-02a5c580b6078630842f4c3db5d92631fada21e9.tar.gz |
Filter out invisible kind arguments during TH reification
Previously, all kind arguments were being reified, which would cause
something like this:
```
type Id a = a
data Proxy (a :: Id k) = Proxy
```
to output
```
data Proxy (a :: Id * k) = Proxy
```
when `Proxy`'s `Info` is reified. The fix is simple: simply call
`filterOutInvisibleTypes` on the kind arguments of a kind synonym
application.
Fixes #11463.
Test Plan: ./validate
Reviewers: austin, bgamari, goldfire
Reviewed By: goldfire
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2081
GHC Trac Issues: #11463
Diffstat (limited to 'testsuite/tests/th/T11463.hs')
-rw-r--r-- | testsuite/tests/th/T11463.hs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/th/T11463.hs b/testsuite/tests/th/T11463.hs new file mode 100644 index 0000000000..1faf5964f4 --- /dev/null +++ b/testsuite/tests/th/T11463.hs @@ -0,0 +1,18 @@ +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TypeInType #-} +module Main where + +import Data.Kind +import Language.Haskell.TH + +type Id1 a = a +type Id2 k (a :: k) = a +data Proxy1 (a :: Id1 k) = Proxy1 +data Proxy2 (a :: Id2 * k) = Proxy2 + +$(return []) + +main :: IO () +main = do + putStrLn $(reify ''Proxy1 >>= stringE . pprint) + putStrLn $(reify ''Proxy2 >>= stringE . pprint) |