diff options
author | Michal Terepeta <michal.terepeta@gmail.com> | 2010-11-27 21:21:16 +0000 |
---|---|---|
committer | Michal Terepeta <michal.terepeta@gmail.com> | 2010-11-27 21:21:16 +0000 |
commit | b633499b3a9508fce26b622f2d0cd836290e9503 (patch) | |
tree | 0258163bf2209f49d1394c9ec80d0ca64a6e2f5f /compiler/rename | |
parent | 94a113df234ef20ec3718a3d9285d238c1dff615 (diff) | |
download | haskell-b633499b3a9508fce26b622f2d0cd836290e9503.tar.gz |
Don't warn of duplicate exports in case of module exports.
But only when the module exports refer to different modules.
See ticket #4478.
Diffstat (limited to 'compiler/rename')
-rw-r--r-- | compiler/rename/RnNames.lhs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs index 9d2f542eca..e8490ac63f 100644 --- a/compiler/rename/RnNames.lhs +++ b/compiler/rename/RnNames.lhs @@ -1061,8 +1061,13 @@ check_occs ie occs names Nothing -> return (extendOccEnv occs name_occ (name, ie)) Just (name', ie') - | name == name' -- Duplicate export - -> do { warn_dup_exports <- doptM Opt_WarnDuplicateExports ; + | name == name' -- Duplicate export + -- But we don't want to warn if the same thing is exported + -- by two different module exports. See ticket #4478. + -> if diffModules ie ie' + then return occs + else do + { warn_dup_exports <- doptM Opt_WarnDuplicateExports ; warnIf warn_dup_exports (dupExportWarn name_occ ie ie') ; return occs } @@ -1072,6 +1077,9 @@ check_occs ie occs names return occs } where name_occ = nameOccName name + -- True if the two IE RdrName are different module exports. + diffModules (IEModuleContents n1) (IEModuleContents n2) = n1 /= n2 + diffModules _ _ = False \end{code} %********************************************************* |