[commit: ghc] ghc-8.0: Improve panicking output (c60141f)

git at git.haskell.org git at git.haskell.org
Wed Mar 23 16:38:43 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/c60141f5856af785c1c1d20d95d4f354a29daccf/ghc

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

commit c60141f5856af785c1c1d20d95d4f354a29daccf
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Sun Mar 20 23:15:13 2016 -0400

    Improve panicking output
    
    (cherry picked from commit e19e58ced6fb410c8aa79b2193513258c58a38bd)


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

c60141f5856af785c1c1d20d95d4f354a29daccf
 compiler/types/Type.hs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs
index 5752058..7b5922f 100644
--- a/compiler/types/Type.hs
+++ b/compiler/types/Type.hs
@@ -861,7 +861,7 @@ piResultTy ty arg
           empty_subst = mkEmptyTCvSubst $ mkInScopeSet $
                         tyCoVarsOfTypes [arg,res]
   | otherwise
-  = panic "piResultTys"
+  = pprPanic "piResultTy" (ppr ty $$ ppr arg)
 
 -- | (piResultTys f_ty [ty1, .., tyn]) gives the type of (f ty1 .. tyn)
 --   where f :: f_ty
@@ -896,7 +896,7 @@ piResultTys ty orig_args@(arg:args)
       Named tv _ -> go (extendVarEnv emptyTvSubstEnv tv arg) res args
 
   | otherwise
-  = panic "piResultTys"
+  = pprPanic "piResultTys1" (ppr ty $$ ppr orig_args)
   where
     go :: TvSubstEnv -> Type -> [Type] -> Type
     go tv_env ty [] = substTy (mkTvSubst in_scope tv_env) ty
@@ -918,7 +918,7 @@ piResultTys ty orig_args@(arg:args)
       = piResultTys ty' all_args
 
       | otherwise
-      = panic "piResultTys"
+      = pprPanic "piResultTys2" (ppr ty $$ ppr orig_args $$ ppr all_args)
 
 {-
 ---------------------------------------------------------------------



More information about the ghc-commits mailing list