diff dmd/import.c @ 875:330f999ade44

Merged DMD 1.038
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 06 Jan 2009 16:33:51 +0100
parents bc982f1ad106
children 78038e540342
line wrap: on
line diff
--- a/dmd/import.c	Tue Jan 06 15:54:48 2009 +0100
+++ b/dmd/import.c	Tue Jan 06 16:33:51 2009 +0100
@@ -112,7 +112,6 @@
     }
     if (!pkg)
 	pkg = mod;
-    mod->semantic();
 
     //printf("-Import::load('%s'), pkg = %p\n", toChars(), pkg);
 }
@@ -136,6 +135,12 @@
 	}
 #endif
 
+	// Modules need a list of each imported module
+	//printf("%s imports %s\n", sc->module->toChars(), mod->toChars());
+	sc->module->aimports.push(mod);
+
+	mod->semantic();
+
 	/* Default to private importing
 	 */
 	protection = sc->protection;
@@ -147,9 +152,6 @@
 	    sc->scopesym->importScope(mod, protection);
 	}
 
-	// Modules need a list of each imported module
-	sc->module->aimports.push(mod);
-
 	if (mod->needmoduleinfo)
 	    sc->module->needmoduleinfo = 1;
 
@@ -224,7 +226,9 @@
     //printf("%s.Import::search(ident = '%s', flags = x%x)\n", toChars(), ident->toChars(), flags);
 
     if (!pkg)
-	load(NULL);
+    {	load(NULL);
+	mod->semantic();
+    }
 
     // Forward it to the package/module
     return pkg->search(loc, ident, flags);