diff dmd/expression.c @ 846:bc982f1ad106

Merged DMD 1.037 frontend
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sat, 13 Dec 2008 13:15:31 +0100
parents 783f67fbdf4a
children 330f999ade44
line wrap: on
line diff
--- a/dmd/expression.c	Sat Dec 13 06:48:00 2008 +0100
+++ b/dmd/expression.c	Sat Dec 13 13:15:31 2008 +0100
@@ -5067,10 +5067,14 @@
 
     if (eright->op == TOKimport)	// also used for template alias's
     {
-	Dsymbol *s;
 	ScopeExp *ie = (ScopeExp *)eright;
 
-	s = ie->sds->search(loc, ident, 0);
+	/* Disable access to another module's private imports.
+	 * The check for 'is sds our current module' is because
+	 * the current module should have access to its own imports.
+	 */
+	Dsymbol *s = ie->sds->search(loc, ident,
+	    (ie->sds->isModule() && ie->sds != sc->module) ? 1 : 0);
 	if (s)
 	{
 	    s = s->toAlias();