diff --git a/dmd/declaration.c b/dmd/declaration.c index 313af74b..b17b78f4 100644 --- a/dmd/declaration.c +++ b/dmd/declaration.c @@ -502,16 +502,16 @@ void AliasDeclaration::semantic(Scope *sc) 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); diff --git a/dmd/func.c b/dmd/func.c index 97e2bf4c..ac4d4313 100644 --- a/dmd/func.c +++ b/dmd/func.c @@ -1560,6 +1560,9 @@ int overloadApply(Module* from, FuncDeclaration *fstart, break; if (next == fstart) break; + if (a->importprot == PROTprivate && a->getModule() != from) + if (FuncDeclaration* fd = next->isFuncDeclaration()) + next = fd->overnext; } else {