-loadExport :: Module -> ExportItem -> RnM d (ModuleName, Avails)
-loadExport this_mod (mod, entities)
- | mod == moduleName this_mod = returnRn (mod, [])
- -- If the module exports anything defined in this module, just ignore it.
- -- Reason: otherwise it looks as if there are two local definition sites
- -- for the thing, and an error gets reported. Easiest thing is just to
- -- filter them out up front. This situation only arises if a module
- -- imports itself, or another module that imported it. (Necessarily,
- -- this invoves a loop.) Consequence: if you say
- -- module A where
- -- import B( AType )
- -- type AType = ...
- --
- -- module B( AType ) where
- -- import {-# SOURCE #-} A( AType )
- --
- -- then you'll get a 'B does not export AType' message. A bit bogus
- -- but it's a bogus thing to do!
-
- | otherwise
+loadExport :: ExportItem -> RnM d (ModuleName, Avails)
+loadExport (mod, entities)