diff --git a/ghc/compiler/rename/RnNames.lhs b/ghc/compiler/rename/RnNames.lhs index 127eef7bb93c31f53296de51493c5f87bd6fdcb1..25d28e0173f0fbd65d9109b7bb485a7ce5f55875 100644 --- a/ghc/compiler/rename/RnNames.lhs +++ b/ghc/compiler/rename/RnNames.lhs @@ -419,10 +419,11 @@ addAvailEnv warn_dups ie env avail occ_avail = nameOccName (availName avail) occ_ie = ieOcc ie key - | occ_ie == occ_avail = occ_avail - | otherwise = occ_ie + | not warn_dups || occ_ie == occ_avail = occ_avail + | otherwise = occ_ie -- export item is a class method, use export occ name instead. - + -- (this is only needed to get more precise warnings about + -- duplicates.) elt = (ie,avail,reports_on) reports_on