changeset 1362:194852badf8c

Don't always expand aliases to FuncDecls to FuncAliasDecls - breaks for single functions.
author Christian Kamm <kamm incasoftware de>
date Sat, 16 May 2009 14:22:09 +0200
parents 78038e540342
children b7c8506e1eed
files dmd/declaration.c dmd/func.c
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/dmd/declaration.c	Sat May 16 12:17:33 2009 +0200
+++ b/dmd/declaration.c	Sat May 16 14:22:09 2009 +0200
@@ -502,16 +502,16 @@
 	FuncDeclaration *f = s->toAlias()->isFuncDeclaration();
 	if (f)
 	{
-	    FuncAliasDeclaration *fa = new FuncAliasDeclaration(f);
-	    fa->importprot = importprot;
 	    if (overnext)
 	    {
+		FuncAliasDeclaration *fa = new FuncAliasDeclaration(f);
+		fa->importprot = importprot;
 		if (!fa->overloadInsert(overnext))
 		    ScopeDsymbol::multiplyDefined(0, f, overnext);
 		overnext = NULL;
+		s = fa;
+		s->parent = sc->parent;
 	    }
-	    s = fa;
-	    s->parent = sc->parent;
 	}
 	if (overnext)
 	    ScopeDsymbol::multiplyDefined(0, s, overnext);
--- a/dmd/func.c	Sat May 16 12:17:33 2009 +0200
+++ b/dmd/func.c	Sat May 16 14:22:09 2009 +0200
@@ -1560,6 +1560,9 @@
 		    break;
 		if (next == fstart)
 		    break;
+		if (a->importprot == PROTprivate && a->getModule() != from)
+		    if (FuncDeclaration* fd = next->isFuncDeclaration())
+			next = fd->overnext;
 	    }
 	    else
 	    {