X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypes%2FInstEnv.lhs;h=15a0c30e770e86a6354a3a7f8e0ad1284272a14d;hb=d9e439063bbd9827df7a6f75471834d8479c3ea3;hp=560c4fc24be1464a8e0c1835138cc92fbd0b0a7b;hpb=940524aec90652b5ef81789c9a453c57c0e42cc9;p=ghc-hetmet.git diff --git a/compiler/types/InstEnv.lhs b/compiler/types/InstEnv.lhs index 560c4fc..15a0c30 100644 --- a/compiler/types/InstEnv.lhs +++ b/compiler/types/InstEnv.lhs @@ -7,6 +7,13 @@ The bits common to TcInstDcls and TcDeriv. \begin{code} +{-# OPTIONS -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings +-- for details + module InstEnv ( DFunId, OverlapFlag(..), Instance(..), pprInstance, pprInstanceHdr, pprInstances, @@ -430,10 +437,11 @@ lookupInstEnv (pkg_ie, home_ie) cls tys (pkg_matches, pkg_unifs) = lookup pkg_ie all_matches = home_matches ++ pkg_matches all_unifs = home_unifs ++ pkg_unifs - pruned_matches - | null all_unifs = foldr insert_overlapping [] all_matches - | otherwise = all_matches -- Non-empty unifs is always an error situation, - -- so don't attempt to pune the matches + pruned_matches = foldr insert_overlapping [] all_matches + -- Even if the unifs is non-empty (an error situation) + -- we still prune the matches, so that the error message isn't + -- misleading (complaining of multiple matches when some should be + -- overlapped away) -------------- lookup env = case lookupUFM env cls of