[commit: ghc] master: Minor refactoring (no change in functionality) (84d9ef0)

git at git.haskell.org git at git.haskell.org
Tue Nov 4 10:38:40 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/84d9ef0f38a11ef9bcfbdc82cbf5bd39c6fc473a/ghc

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

commit 84d9ef0f38a11ef9bcfbdc82cbf5bd39c6fc473a
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Oct 29 17:51:41 2014 +0000

    Minor refactoring (no change in functionality)


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

84d9ef0f38a11ef9bcfbdc82cbf5bd39c6fc473a
 compiler/typecheck/TcErrors.lhs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/typecheck/TcErrors.lhs b/compiler/typecheck/TcErrors.lhs
index d2d8133..927f522 100644
--- a/compiler/typecheck/TcErrors.lhs
+++ b/compiler/typecheck/TcErrors.lhs
@@ -989,7 +989,9 @@ mkDictErr ctxt cts
   = ASSERT( not (null cts) )
     do { inst_envs <- tcGetInstEnvs
        ; fam_envs  <- tcGetFamInstEnvs
-       ; lookups   <- mapM (lookup_cls_inst inst_envs) cts
+       ; let (ct1:_) = cts  -- ct1 just for its location
+             min_cts = elim_superclasses cts
+       ; lookups   <- mapM (lookup_cls_inst inst_envs) min_cts
        ; let (no_inst_cts, overlap_cts) = partition is_no_inst lookups
 
        -- Report definite no-instance errors,
@@ -1000,8 +1002,6 @@ mkDictErr ctxt cts
        ; (ctxt, err) <- mk_dict_err fam_envs ctxt (head (no_inst_cts ++ overlap_cts))
        ; mkErrorMsg ctxt ct1 err }
   where
-    ct1:_ = elim_superclasses cts
-
     no_givens = null (getUserGivens ctxt)
 
     is_no_inst (ct, (matches, unifiers, _))



More information about the ghc-commits mailing list