[commit: ghc] master: CoreLint: Slightly improve case type annotation error msgs (8d33af9)

git at git.haskell.org git at git.haskell.org
Fri Jun 17 21:20:09 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8d33af90d20c86bc63f1fa155583daa9a52d42bc/ghc

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

commit 8d33af90d20c86bc63f1fa155583daa9a52d42bc
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Fri Jun 17 21:23:15 2016 +0000

    CoreLint: Slightly improve case type annotation error msgs


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

8d33af90d20c86bc63f1fa155583daa9a52d42bc
 compiler/coreSyn/CoreLint.hs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs
index 36a7e2b..d905b8c 100644
--- a/compiler/coreSyn/CoreLint.hs
+++ b/compiler/coreSyn/CoreLint.hs
@@ -1909,7 +1909,9 @@ mkDefaultArgsMsg args
 mkCaseAltMsg :: CoreExpr -> Type -> Type -> MsgDoc
 mkCaseAltMsg e ty1 ty2
   = hang (text "Type of case alternatives not the same as the annotation on case:")
-         4 (vcat [ppr ty1, ppr ty2, ppr e])
+         4 (vcat [ text "Actual type:" <+> ppr ty1,
+                   text "Annotation on case:" <+> ppr ty2,
+                   text "Alt Rhs:" <+> ppr e ])
 
 mkScrutMsg :: Id -> Type -> Type -> TCvSubst -> MsgDoc
 mkScrutMsg var var_ty scrut_ty subst



More information about the ghc-commits mailing list