[commit: ghc] wip/rae: Always use KindedTV when reifying. (#8953) (a8acb09)

git at git.haskell.org git at git.haskell.org
Fri Oct 31 17:36:27 UTC 2014


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

On branch  : wip/rae
Link       : http://ghc.haskell.org/trac/ghc/changeset/a8acb095a1d050d909f7b4ce2d5b7bdf7cdd5f0d/ghc

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

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

    Always use KindedTV when reifying. (#8953)


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

a8acb095a1d050d909f7b4ce2d5b7bdf7cdd5f0d
 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