Always use KindedTV when reifying. (#8953)
authorRichard Eisenberg <eir@cis.upenn.edu>
Tue, 21 Oct 2014 14:48:49 +0000 (10:48 -0400)
committerRichard Eisenberg <eir@cis.upenn.edu>
Sun, 2 Nov 2014 01:12:54 +0000 (21:12 -0400)
compiler/typecheck/TcSplice.lhs

index aebf430..99deb0f 100644 (file)
@@ -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