Bug 20796 – protection attribute package(x.y) does not bind to one of ancestor packages of module x.y when declared in x/y/package.d
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-05-05T03:26:38Z
Last change time
2022-09-29T13:57:38Z
Keywords
pull
Assigned to
No Owner
Creator
Nicholas Wilson
Comments
Comment #0 by iamthewilsonator — 2020-05-05T03:26:38Z
file x/y/package.d:
module x.y;
package(x.y) void foo();
results in
x/y/package.d(2): Error: protection attribute package(x.y) does not bind to one of ancestor packages of module x.y
which is patently false.
In particular this makes it very annoying to convert a large module, say x.y, into a package and convert all private protection symbols to package(x.y) symbols when moving symbols from x.y to x.y.a.
Comment #1 by dlang-bot — 2020-05-05T04:33:27Z
@thewilsonator created dlang/dmd pull request #11100 "Fix issue 20796: package protected symbol declared in the same packag…" fixing this issue:
- Fix issue 20796: package protected symbol declared in the same package.d don't work
https://github.com/dlang/dmd/pull/11100
Comment #2 by dlang-bot — 2020-05-05T10:19:38Z
dlang/dmd pull request #11100 "Fix issue 20796: package protected symbol declared in the same packag…" was merged into master:
- 5cbd942fcd1939bb2c688e3efdfc8b89f1d4336b by Nicholas Lindsay Wilson:
Fix issue 20796: package protected symbol declared in the same package.d don't work
https://github.com/dlang/dmd/pull/11100
Comment #3 by dkorpel — 2022-09-29T13:57:38Z
*** Issue 17950 has been marked as a duplicate of this issue. ***