From: sof Date: Wed, 30 Sep 1998 07:52:04 +0000 (+0000) Subject: [project @ 1998-09-30 07:52:04 by sof] X-Git-Tag: Approx_2487_patches~258 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=23ceae42cd7ce3e759dd4271cc0dbad179a179f8;p=ghc-hetmet.git [project @ 1998-09-30 07:52:04 by sof] merged from new-rts: permit unsafeCoerce# to be applied to values with an unboxed type --- diff --git a/ghc/compiler/prelude/PrelVals.lhs b/ghc/compiler/prelude/PrelVals.lhs index 1aea62c..733c49b 100644 --- a/ghc/compiler/prelude/PrelVals.lhs +++ b/ghc/compiler/prelude/PrelVals.lhs @@ -23,7 +23,7 @@ import CoreSyn -- quite a bit import IdInfo -- quite a bit import Name ( mkWiredInIdName, Module ) import Type -import TyVar ( openAlphaTyVar, alphaTyVar, betaTyVar, TyVar ) +import TyVar ( openAlphaTyVar, openAlphaTyVars, alphaTyVar, betaTyVar, TyVar ) import Unique -- lots of *Keys import Util ( panic ) \end{code} @@ -125,10 +125,14 @@ unsafeCoerceId = pcMiscPrelId unsafeCoerceIdKey pREL_GHC SLIT("unsafeCoerce#") ty (mk_inline_unfolding template) where - ty = mkForAllTys [alphaTyVar,betaTyVar] (mkFunTy alphaTy betaTy) - [x] = mkTemplateLocals [alphaTy] - template = mkLam [alphaTyVar,betaTyVar] [x] ( - Note (Coerce betaTy alphaTy) (Var x)) + (alphaTyVar:betaTyVar:_) = openAlphaTyVars + alphaTy = mkTyVarTy alphaTyVar + betaTy = mkTyVarTy betaTyVar + ty = mkForAllTys [alphaTyVar,betaTyVar] (mkFunTy alphaTy betaTy) + [x] = mkTemplateLocals [alphaTy] + template = mkLam [alphaTyVar,betaTyVar] [x] $ + Note (Coerce betaTy alphaTy) (Var x) + \end{code} We want \tr{GHCbase.trace} to be wired in