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

git at git.haskell.org git at git.haskell.org
Thu Nov 24 09:12:27 UTC 2016


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

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

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

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

    Make a panic into an ASSERT


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

16036a53c0165668e9d9599eab1b4c58a725f5e0
 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