From: simonpj Date: Tue, 6 Apr 2004 08:45:55 +0000 (+0000) Subject: [project @ 2004-04-06 08:45:55 by simonpj] X-Git-Tag: Initial_conversion_from_CVS_complete~1905 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=09bdc279ae8846c24faae2a98267c03c5b2366ad [project @ 2004-04-06 08:45:55 by simonpj] Revert to previous kind-check of for-alls, to avoid error message worsening --- diff --git a/ghc/compiler/typecheck/TcHsType.lhs b/ghc/compiler/typecheck/TcHsType.lhs index 519d29f..c7e0cba 100644 --- a/ghc/compiler/typecheck/TcHsType.lhs +++ b/ghc/compiler/typecheck/TcHsType.lhs @@ -313,19 +313,16 @@ kc_hs_type (HsPredTy pred) kc_hs_type (HsForAllTy exp tv_names context ty) = kcHsTyVars tv_names $ \ tv_names' -> kcHsContext context `thenM` \ ctxt' -> - kcHsType ty `thenM` \ (ty', kind) -> + kcLiftedType ty `thenM` \ ty' -> -- The body of a forall is usually a type, but in principle -- there's no reason to prohibit *unlifted* types. -- In fact, GHC can itself construct a function with an -- unboxed tuple inside a for-all (via CPR analyis; see -- typecheck/should_compile/tc170) -- - -- Furthermore, in newtype deriving we allow - -- deriving( forall a. C [a] ) - -- where C :: *->*->*, so it's awkward to prohibit higher-kinded - -- bodies. In any case, if there is a higher-kinded body - -- and we propagate that up, the caller will find any bugs. - returnM (HsForAllTy exp tv_names' ctxt' ty', kind) + -- Still, that's only for internal interfaces, which aren't + -- kind-checked, so we only allow liftedTypeKind here + returnM (HsForAllTy exp tv_names' ctxt' ty', liftedTypeKind) --------------------------- kcApps :: TcKind -- Function kind