Commit 34c2b025 authored by simonpj's avatar simonpj
Browse files

[project @ 2003-10-21 13:14:12 by simonpj]

Wibbles
parent 1bade0c9
...@@ -563,11 +563,14 @@ checkNewInst dflags ies dfun ...@@ -563,11 +563,14 @@ checkNewInst dflags ies dfun
Nothing -> return () Nothing -> return ()
-- Check for duplicate instance decls -- Check for duplicate instance decls
; mappM_ (dupInstErr dfun) dup_dfuns } ; case dup_dfuns of
dup_dfun : _ -> dupInstErr dfun dup_dfun
[] -> return ()
}
where where
(tvs, _, cls, tys) = tcSplitDFunTy (idType dfun) (tvs, _, cls, tys) = tcSplitDFunTy (idType dfun)
(matches, _) = lookupInstEnv dflags ies cls tys (matches, _) = lookupInstEnv dflags ies cls tys
dup_dfuns = [dfun | (_, (_, dup_tys, dup_dfun)) <- matches, dup_dfuns = [dup_dfun | (_, (_, dup_tys, dup_dfun)) <- matches,
isJust (matchTys (mkVarSet tvs) tys dup_tys)] isJust (matchTys (mkVarSet tvs) tys dup_tys)]
-- Find memebers of the match list which -- Find memebers of the match list which
-- dfun itself matches. If the match is 2-way, it's a duplicate -- dfun itself matches. If the match is 2-way, it's a duplicate
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment