[commit: ghc] master: Always use KindedTV when reifying. (#8953) (9fd19f9)

git at git.haskell.org git at git.haskell.org
Sun Nov 2 03:53:33 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9fd19f960f37b1369f8a3453b05c1805e0057232/ghc

>---------------------------------------------------------------

commit 9fd19f960f37b1369f8a3453b05c1805e0057232
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Tue Oct 21 10:48:49 2014 -0400

    Always use KindedTV when reifying. (#8953)


>---------------------------------------------------------------

9fd19f960f37b1369f8a3453b05c1805e0057232
 compiler/typecheck/TcSplice.lhs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/compiler/typecheck/TcSplice.lhs b/compiler/typecheck/TcSplice.lhs
index aebf430..99deb0f 100644
--- a/compiler/typecheck/TcSplice.lhs
+++ b/compiler/typecheck/TcSplice.lhs
@@ -1433,9 +1433,10 @@ reifyTyVars :: [TyVar]
             -> TcM [TH.TyVarBndr]
 reifyTyVars tvs = mapM reify_tv $ filter isTypeVar tvs
   where
-    reify_tv tv | isLiftedTypeKind kind = return (TH.PlainTV  name)
-                | otherwise             = do kind' <- reifyKind kind
-                                             return (TH.KindedTV name kind')
+    -- even if the kind is *, we need to include a kind annotation,
+    -- in case a poly-kind would be inferred without the annotation.
+    -- See #8953 or test th/T8953
+    reify_tv tv = TH.KindedTV name <$> reifyKind kind
       where
         kind = tyVarKind tv
         name = reifyName tv



More information about the ghc-commits mailing list