X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRnNames.lhs;h=58dd7a6e76e946df7165289708362833670de14b;hb=f83ad713ad73e583fd138bb17e7341041b36a416;hp=db95e47d8bcb5b7b5ac611eaf098535f1792f3e0;hpb=5c18c653824cc629940a8b73afcd59c78c1e97bb;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/RnNames.lhs b/ghc/compiler/rename/RnNames.lhs index db95e47..58dd7a6 100644 --- a/ghc/compiler/rename/RnNames.lhs +++ b/ghc/compiler/rename/RnNames.lhs @@ -31,6 +31,7 @@ import RnMonad import FiniteMap import PrelMods +import PrelInfo ( main_RDR ) import UniqFM ( lookupUFM ) import Bag ( bagToList ) import Maybes ( maybeToBool ) @@ -523,8 +524,13 @@ exportsFromAvail :: Module -- Warns about identical exports. -- Complains about exports items not in scope exportsFromAvail this_mod Nothing export_avails global_name_env - = exportsFromAvail this_mod (Just [IEModuleContents this_mod]) - export_avails global_name_env + = exportsFromAvail this_mod true_exports export_avails global_name_env + where + true_exports = Just $ if this_mod == mAIN + then [IEVar main_RDR] + -- export Main.main *only* unless otherwise specified, + else [IEModuleContents this_mod] + -- but for all other modules export everything. exportsFromAvail this_mod (Just export_items) (mod_avail_env, entity_avail_env)