[commit: ghc] wip/new-flatten-skolems-Oct14: Minor refactoring (no change in functionality) (f61b89f)

git at git.haskell.org git at git.haskell.org
Fri Oct 31 13:43:35 UTC 2014


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

On branch  : wip/new-flatten-skolems-Oct14
Link       : http://ghc.haskell.org/trac/ghc/changeset/f61b89fce22bdfd64f48d2fe26844e118e7e384d/ghc

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

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

    Minor refactoring (no change in functionality)


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

f61b89fce22bdfd64f48d2fe26844e118e7e384d
 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