From: simonpj Date: Tue, 21 Oct 2003 13:14:12 +0000 (+0000) Subject: [project @ 2003-10-21 13:14:12 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~342 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=34c2b0252cd496d5db5113bbe1b4ca0b18dec946;p=ghc-hetmet.git [project @ 2003-10-21 13:14:12 by simonpj] Wibbles --- diff --git a/ghc/compiler/typecheck/Inst.lhs b/ghc/compiler/typecheck/Inst.lhs index c07f806..11d41a4 100644 --- a/ghc/compiler/typecheck/Inst.lhs +++ b/ghc/compiler/typecheck/Inst.lhs @@ -563,12 +563,15 @@ checkNewInst dflags ies dfun Nothing -> return () -- Check for duplicate instance decls - ; mappM_ (dupInstErr dfun) dup_dfuns } + ; case dup_dfuns of + dup_dfun : _ -> dupInstErr dfun dup_dfun + [] -> return () + } where (tvs, _, cls, tys) = tcSplitDFunTy (idType dfun) (matches, _) = lookupInstEnv dflags ies cls tys - dup_dfuns = [dfun | (_, (_, dup_tys, dup_dfun)) <- matches, - isJust (matchTys (mkVarSet tvs) tys dup_tys)] + dup_dfuns = [dup_dfun | (_, (_, dup_tys, dup_dfun)) <- matches, + isJust (matchTys (mkVarSet tvs) tys dup_tys)] -- Find memebers of the match list which -- dfun itself matches. If the match is 2-way, it's a duplicate