Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : ghc-new-flavor

http://hackage.haskell.org/trac/ghc/changeset/c6411c394db405bf1624438a4535ed5ce9b86219

>---------------------------------------------------------------

commit c6411c394db405bf1624438a4535ed5ce9b86219
Author: Dimitrios Vytiniotis <[email protected]>
Date:   Thu Mar 29 00:20:12 2012 +0200

    Slightly more informal message when EvCast fails.

>---------------------------------------------------------------

 compiler/coreSyn/CoreLint.lhs |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/compiler/coreSyn/CoreLint.lhs b/compiler/coreSyn/CoreLint.lhs
index b9054f4..4af5b1c 100644
--- a/compiler/coreSyn/CoreLint.lhs
+++ b/compiler/coreSyn/CoreLint.lhs
@@ -271,7 +271,7 @@ lintCoreExpr (Cast expr co)
   = do { expr_ty <- lintCoreExpr expr
        ; co' <- applySubstCo co
        ; (_, from_ty, to_ty) <- lintCoercion co'
-       ; checkTys from_ty expr_ty (mkCastErr from_ty expr_ty)
+       ; checkTys from_ty expr_ty (mkCastErr expr co' from_ty expr_ty)
        ; return to_ty }
 
 lintCoreExpr (Tick (Breakpoint _ ids) expr)
@@ -1270,12 +1270,14 @@ mkUnboxedTupleMsg binder
   = vcat [hsep [ptext (sLit "A variable has unboxed tuple type:"), ppr binder],
          hsep [ptext (sLit "Binder's type:"), ppr (idType binder)]]
 
-mkCastErr :: Type -> Type -> MsgDoc
-mkCastErr from_ty expr_ty
+mkCastErr :: CoreExpr -> Coercion -> Type -> Type -> MsgDoc
+mkCastErr expr co from_ty expr_ty
   = vcat [ptext (sLit "From-type of Cast differs from type of enclosed 
expression"),
          ptext (sLit "From-type:") <+> ppr from_ty,
-         ptext (sLit "Type of enclosed expr:") <+> ppr expr_ty
-    ]
+         ptext (sLit "Type of enclosed expr:") <+> ppr expr_ty,
+          ptext (sLit "Actual enclosed expr:") <+> ppr expr,
+          ptext (sLit "Coercion used in cast:") <+> ppr co
+         ]
 
 dupVars :: [[Var]] -> MsgDoc
 dupVars vars



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to