X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FdeSugar%2FDsCCall.lhs;h=a041665f23547a6269f24794c5d9cedc1921c5b8;hp=0541f5d97f6f608836e922cf63737cd441ba3fb0;hb=5e0ea427646a5474dd7c659b0713c6a62d8c99c7;hpb=f1c0fd99f16322fe222c6fcf4626a6162ad0a466 diff --git a/compiler/deSugar/DsCCall.lhs b/compiler/deSugar/DsCCall.lhs index 0541f5d..a041665 100644 --- a/compiler/deSugar/DsCCall.lhs +++ b/compiler/deSugar/DsCCall.lhs @@ -34,7 +34,7 @@ import Type ( Type, isUnLiftedType, mkFunTys, mkFunTy, splitRecNewType_maybe, splitForAllTy_maybe, isUnboxedTupleType ) -import Coercion ( Coercion, splitRecNewTypeCo_maybe, mkSymCoercion ) +import Coercion ( Coercion, splitNewTypeRepCo_maybe, mkSymCoercion ) import PrimOp ( PrimOp(..) ) import TysPrim ( realWorldStatePrimTy, intPrimTy, byteArrayPrimTyCon, mutableByteArrayPrimTyCon, @@ -160,8 +160,8 @@ unboxArg arg = returnDs (arg, \body -> body) -- Recursive newtypes - | Just(rep_ty, co) <- splitRecNewTypeCo_maybe arg_ty - = unboxArg (mkCoerce (mkSymCoercion co) arg) + | Just(rep_ty, co) <- splitNewTypeRepCo_maybe arg_ty + = unboxArg (mkCoerce co arg) -- Booleans | Just (tc,_) <- splitTyConApp_maybe arg_ty, @@ -399,9 +399,9 @@ resultWrapper result_ty (LitAlt (mkMachInt 0),[],Var falseDataConId)]) -- Recursive newtypes - | Just (rep_ty, co) <- splitRecNewTypeCo_maybe result_ty + | Just (rep_ty, co) <- splitNewTypeRepCo_maybe result_ty = resultWrapper rep_ty `thenDs` \ (maybe_ty, wrapper) -> - returnDs (maybe_ty, \e -> mkCoerce co (wrapper e)) + returnDs (maybe_ty, \e -> mkCoerce (mkSymCoercion co) (wrapper e)) -- The type might contain foralls (eg. for dummy type arguments, -- referring to 'Ptr a' is legal).