[commit: ghc] wip/spj-tc-branch3: Make a panic into an ASSERT (e26f3b7)

git at git.haskell.org git at git.haskell.org
Tue Oct 25 16:42:22 UTC 2016


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

On branch  : wip/spj-tc-branch3
Link       : http://ghc.haskell.org/trac/ghc/changeset/e26f3b7b098ab776e7a80259b840f6c2a89e3cc0/ghc

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

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

    Make a panic into an ASSERT


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

e26f3b7b098ab776e7a80259b840f6c2a89e3cc0
 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 c40be7b..54ac530 100644
--- a/compiler/typecheck/FunDeps.hs
+++ b/compiler/typecheck/FunDeps.hs
@@ -194,11 +194,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
   , tys `lengthAtLeast` 2
   , let (cls_tvs, cls_fds) = classTvsFds cls
         instances          = classInstances inst_env cls



More information about the ghc-commits mailing list