Skip to content

Commit

Permalink
Merge pull request #5358 from WalterBright/fix15578.d
Browse files Browse the repository at this point in the history
fix Issue 15578 - Should have access to namespace private symbols fro…
  • Loading branch information
andralex committed Jan 23, 2016
2 parents c6ac10a + 92e637e commit 22b1c0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dsymbol.d
Expand Up @@ -1315,7 +1315,8 @@ public:
a = mergeOverloadSet(ident, a, s);
s = a;
}
if (!(flags & IgnoreErrors) && s.prot().kind == PROTprivate && !s.parent.isTemplateMixin())
if (!(flags & IgnoreErrors) && s.prot().kind == PROTprivate &&
!s.parent.isTemplateMixin() && !s.parent.isNspace())
{
if (!s.isImport())
error(loc, "%s %s is private", s.kind(), s.toPrettyChars());
Expand Down
10 changes: 10 additions & 0 deletions test/compilable/test15578.d
@@ -0,0 +1,10 @@
private:
int j;
extern(C++, ns) int k;

void f()
{
j = 0; // works as expected
k = 0; // Error: variable foo.ns.k is private
}

0 comments on commit 22b1c0b

Please sign in to comment.