From 23ceae42cd7ce3e759dd4271cc0dbad179a179f8 Mon Sep 17 00:00:00 2001 From: sof Date: Wed, 30 Sep 1998 07:52:04 +0000 Subject: [PATCH] [project @ 1998-09-30 07:52:04 by sof] merged from new-rts: permit unsafeCoerce# to be applied to values with an unboxed type --- ghc/compiler/prelude/PrelVals.lhs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 -- 1.7.10.4