X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypes%2FInstEnv.lhs;h=7aaea5cff768bd204751589e519f104acf5174fa;hb=474b582b68ea9289f3da4355da816164138604b0;hp=cc0c2dd7c74871706d098f1c02218c2dc1c88c0e;hpb=2c8701fbebc0a6a49248392b53d977f0afdea4ec;p=ghc-hetmet.git diff --git a/compiler/types/InstEnv.lhs b/compiler/types/InstEnv.lhs index cc0c2dd..7aaea5c 100644 --- a/compiler/types/InstEnv.lhs +++ b/compiler/types/InstEnv.lhs @@ -134,7 +134,7 @@ pprInstance :: Instance -> SDoc -- Prints the Instance as an instance declaration pprInstance ispec@(Instance { is_flag = flag }) = hang (pprInstanceHdr ispec) - 2 (ptext SLIT("--") <+> (pprDefnLoc (getSrcLoc ispec))) + 2 (ptext SLIT("--") <+> (pprDefnLoc (getSrcSpan ispec))) -- * pprInstanceHdr is used in VStudio to populate the ClassView tree pprInstanceHdr :: Instance -> SDoc @@ -430,10 +430,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