summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsCCall.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-07-29 16:38:44 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2015-07-30 11:03:08 +0100
commit92d2567230e28010e425b47057ccca66d1a9a712 (patch)
tree2a51a154fce83971874a6b9604b3d02e762b28e8 /compiler/deSugar/DsCCall.hs
parent4e8d74d2362fbb025614ddeedfa3a9202bb6f2bb (diff)
downloadhaskell-92d2567230e28010e425b47057ccca66d1a9a712.tar.gz
Define DsUtils.mkCastDs and use it
This change avoids a spurious WARNing from mkCast. In the output of the desugarer (only, I think) we can have a cast where the type of the expression and cast don't syntactically match, because of an enclosing type-let binding.
Diffstat (limited to 'compiler/deSugar/DsCCall.hs')
-rw-r--r--compiler/deSugar/DsCCall.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/deSugar/DsCCall.hs b/compiler/deSugar/DsCCall.hs
index 19ac062ce9..26551b58fa 100644
--- a/compiler/deSugar/DsCCall.hs
+++ b/compiler/deSugar/DsCCall.hs
@@ -21,7 +21,7 @@ module DsCCall
import CoreSyn
import DsMonad
-
+import DsUtils( mkCastDs )
import CoreUtils
import MkCore
import Var
@@ -138,7 +138,7 @@ unboxArg arg
-- Recursive newtypes
| Just(co, _rep_ty) <- topNormaliseNewType_maybe arg_ty
- = unboxArg (mkCast arg co)
+ = unboxArg (mkCastDs arg co)
-- Booleans
| Just tc <- tyConAppTyCon_maybe arg_ty,
@@ -338,7 +338,7 @@ resultWrapper result_ty
-- Newtypes
| Just (co, rep_ty) <- topNormaliseNewType_maybe result_ty
= do (maybe_ty, wrapper) <- resultWrapper rep_ty
- return (maybe_ty, \e -> mkCast (wrapper e) (mkSymCo co))
+ return (maybe_ty, \e -> mkCastDs (wrapper e) (mkSymCo co))
-- The type might contain foralls (eg. for dummy type arguments,
-- referring to 'Ptr a' is legal).