Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/dmd/attrib.d
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,13 @@ extern (C++) final class ProtDeclaration : AttribDeclaration
super(decl);
this.loc = loc;
this.protection.kind = Prot.Kind.package_;
this.protection.pkg = null;
this.pkg_identifiers = pkg_identifiers;
if (pkg_identifiers !is null && pkg_identifiers.dim > 0)
{
Dsymbol tmp;
Package.resolve(pkg_identifiers, &tmp, null);
protection.pkg = tmp ? tmp.isPackage() : null;
}
}

override Dsymbol syntaxCopy(Dsymbol s)
Expand Down
6 changes: 6 additions & 0 deletions test/compilable/extra-files/header18364.di
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module foo.bar.ba;
nothrow pure @nogc @safe package(foo)
{
void foo();
nothrow pure @nogc @safe package(foo.bar) void foo2();
}
8 changes: 8 additions & 0 deletions test/compilable/header18364.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// REQUIRED_ARGS: -c -o- -Hf${RESULTS_DIR}/compilable/header18364.di
// POST_SCRIPT: compilable/extra-files/header-postscript.sh header18364
module foo.bar.ba;
@safe pure nothrow @nogc package(foo):
void foo();

@safe pure nothrow @nogc package(foo.bar):
void foo2();