diff options
Diffstat (limited to 'compiler/typecheck/TcRnExports.hs')
-rw-r--r-- | compiler/typecheck/TcRnExports.hs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/compiler/typecheck/TcRnExports.hs b/compiler/typecheck/TcRnExports.hs index a79e30d5f2..e2b6a61bfa 100644 --- a/compiler/typecheck/TcRnExports.hs +++ b/compiler/typecheck/TcRnExports.hs @@ -181,10 +181,15 @@ exports_from_avail Nothing rdr_env _imports _this_mod -- The same as (module M) where M is the current module name, -- so that's how we handle it, except we also export the data family -- when a data instance is exported. - = let avails = - map fix_faminst . gresToAvailInfo - . filter isLocalGRE . globalRdrEnvElts $ rdr_env - in return (Nothing, avails) + = do { + ; warnMissingExportList <- woptM Opt_WarnMissingExportList + ; warnIfFlag Opt_WarnMissingExportList + warnMissingExportList + (missingModuleExportWarn $ moduleName _this_mod) + ; let avails = + map fix_faminst . gresToAvailInfo + . filter isLocalGRE . globalRdrEnvElts $ rdr_env + ; return (Nothing, avails) } where -- #11164: when we define a data instance -- but not data family, re-export the family @@ -659,6 +664,11 @@ nullModuleExport :: ModuleName -> SDoc nullModuleExport mod = text "The export item `module" <+> ppr mod <> ptext (sLit "' exports nothing") +missingModuleExportWarn :: ModuleName -> SDoc +missingModuleExportWarn mod + = text "The export item `module" <+> ppr mod <> + ptext (sLit "' is missing an export list") + dodgyExportWarn :: Name -> SDoc dodgyExportWarn item |