-exportClashErr occ_name ie1 ie2
- = hsep [ptext SLIT("The export items"), quotes (ppr ie1)
- ,ptext SLIT("and"), quotes (ppr ie2)
- ,ptext SLIT("create conflicting exports for"), quotes (ppr occ_name)]
+exportClashErr name1 name2 ie1 ie2
+ | different_items
+ = sep [ ptext SLIT("The export items") <+> quotes (ppr ie1)
+ <+> ptext SLIT("and") <+> quotes (ppr ie2)
+ , ptext SLIT("create") <+> name_msg <+> ptext SLIT("respectively") ]
+ | otherwise
+ = sep [ ptext SLIT("The export item") <+> quotes (ppr ie1)
+ , ptext SLIT("creates") <+> name_msg ]
+ where
+ name_msg = ptext SLIT("conflicting exports for") <+> quotes (ppr name1)
+ <+> ptext SLIT("and") <+> quotes (ppr name2)
+ different_items -- This only comes into play when we have a single
+ -- 'module M' export item which gives rise to conflicts
+ = case (ie1,ie2) of
+ (IEModuleContents m1, IEModuleContents m2) -> m1 /= m2
+ other -> True