diff --git a/src/module.c b/src/module.c index 4521de6ff399..837810a74956 100644 --- a/src/module.c +++ b/src/module.c @@ -228,6 +228,9 @@ Module *Module::load(Loc loc, Identifiers *packages, Identifier *ident) if (result) m->srcfile = new File(result); + if (!m->read(loc)) + return NULL; + if (global.params.verbose) { fprintf(global.stdmsg, "import "); @@ -242,9 +245,6 @@ Module *Module::load(Loc loc, Identifiers *packages, Identifier *ident) fprintf(global.stdmsg, "%s\t(%s)\n", ident->toChars(), m->srcfile->toChars()); } - if (!m->read(loc)) - return NULL; - m->parse(); Target::loadModule(m); @@ -277,7 +277,8 @@ bool Module::read(Loc loc) } if (!global.gag) - { /* Print path + { + /* Print path */ if (global.path) {