Commit 446b09a5 authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Fixed self-export of modules.

Now, self exports like in

module M (module M, module Other) where ...

are valid again.
parent 1ee39e61
......@@ -158,14 +158,12 @@ expandTypeAll tc = do
expandModule :: ModuleIdent -> ECM [Export]
expandModule em = do
m <- getModuleIdent
locals <- if em == m then expandLocalModule else return []
reexport <- do
knownModules <- getImportedModules
if em `Set.member` knownModules
then expandImportedModule em
else report (errModuleNotImported em) >> return []
return $ locals ++ reexport
isLocal <- (em ==) `liftM` getModuleIdent
isForeign <- (Set.member em) `liftM` getImportedModules
locals <- if isLocal then expandLocalModule else return []
foreigns <- if isForeign then expandImportedModule em else return []
unless (isLocal || isForeign) $ report $ errModuleNotImported em
return $ locals ++ foreigns
expandLocalModule :: ECM [Export]
expandLocalModule = do
......
module ExportError (module Foo) where
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment