From: simonpj@microsoft.com Date: Tue, 27 Jul 2010 13:15:38 +0000 (+0000) Subject: Give the correct kind to unsafeCoerce# X-Git-Tag: 2010-11-18~400 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=5e3c9a59c4827b1fbde59461076b4839d57efd7c Give the correct kind to unsafeCoerce# --- diff --git a/compiler/basicTypes/MkId.lhs b/compiler/basicTypes/MkId.lhs index 6e7b0c0..d7cd8cd 100644 --- a/compiler/basicTypes/MkId.lhs +++ b/compiler/basicTypes/MkId.lhs @@ -920,11 +920,11 @@ unsafeCoerceId info = noCafIdInfo `setUnfoldingInfo` mkCompulsoryUnfolding rhs - ty = mkForAllTys [openAlphaTyVar,openBetaTyVar] - (mkFunTy openAlphaTy openBetaTy) - [x] = mkTemplateLocals [openAlphaTy] - rhs = mkLams [openAlphaTyVar,openBetaTyVar,x] $ - Cast (Var x) (mkUnsafeCoercion openAlphaTy openBetaTy) + ty = mkForAllTys [argAlphaTyVar,openBetaTyVar] + (mkFunTy argAlphaTy openBetaTy) + [x] = mkTemplateLocals [argAlphaTy] + rhs = mkLams [argAlphaTyVar,openBetaTyVar,x] $ + Cast (Var x) (mkUnsafeCoercion argAlphaTy openBetaTy) ------------------------------------------------ nullAddrId :: Id diff --git a/compiler/prelude/TysPrim.lhs b/compiler/prelude/TysPrim.lhs index 3490a82..efeced2 100644 --- a/compiler/prelude/TysPrim.lhs +++ b/compiler/prelude/TysPrim.lhs @@ -12,6 +12,7 @@ module TysPrim( alphaTyVars, betaTyVars, alphaTyVar, betaTyVar, gammaTyVar, deltaTyVar, alphaTy, betaTy, gammaTy, deltaTy, openAlphaTy, openBetaTy, openAlphaTyVar, openBetaTyVar, openAlphaTyVars, + argAlphaTy, argAlphaTyVar, primTyCons, @@ -180,7 +181,12 @@ openAlphaTyVars@(openAlphaTyVar:openBetaTyVar:_) = tyVarList openTypeKind openAlphaTy, openBetaTy :: Type openAlphaTy = mkTyVarTy openAlphaTyVar -openBetaTy = mkTyVarTy openBetaTyVar +openBetaTy = mkTyVarTy openBetaTyVar + +argAlphaTyVar :: TyVar +(argAlphaTyVar : _) = tyVarList argTypeKind +argAlphaTy :: Type +argAlphaTy = mkTyVarTy argAlphaTyVar \end{code}