[commit: ghc] master: Make a panic into an ASSERT (9a431e5)

git at git.haskell.org git at git.haskell.org
Fri Nov 25 11:30:38 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9a431e5116c132f08f8296c6e8fbbbe7ba7a20b6/ghc

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

commit 9a431e5116c132f08f8296c6e8fbbbe7ba7a20b6
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Oct 25 15:21:31 2016 +0100

    Make a panic into an ASSERT


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

9a431e5116c132f08f8296c6e8fbbbe7ba7a20b6
 compiler/typecheck/FunDeps.hs | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/compiler/typecheck/FunDeps.hs b/compiler/typecheck/FunDeps.hs
index 4da6795..0ca22bd 100644
--- a/compiler/typecheck/FunDeps.hs
+++ b/compiler/typecheck/FunDeps.hs
@@ -195,11 +195,9 @@ improveFromInstEnv :: InstEnvs
                    -> [FunDepEqn loc] -- Needs to be a FunDepEqn because
                                       -- of quantified variables
 -- Post: Equations oriented from the template (matching instance) to the workitem!
-improveFromInstEnv _inst_env _ pred
-  | not (isClassPred pred)
-  = panic "improveFromInstEnv: not a class predicate"
 improveFromInstEnv inst_env mk_loc pred
-  | Just (cls, tys) <- getClassPredTys_maybe pred
+  | Just (cls, tys) <- ASSERT2( isClassPred pred, ppr pred )
+                       getClassPredTys_maybe pred
   , let (cls_tvs, cls_fds) = classTvsFds cls
         instances          = classInstances inst_env cls
         rough_tcs          = roughMatchTcs tys



More information about the ghc-commits mailing list