[Issue 17950] New: cannot declare package internal symbol in package module
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Oct 29 15:02:26 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=17950
Issue ID: 17950
Summary: cannot declare package internal symbol in package
module
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: code at dawg.eu
mkdir -p pkg
cat > pkg/package.d << CODE
module pkg;
package(pkg) int sym;
CODE
dmd -c -o- pkg/package.d
----
pkg/package.d(2): Error: protection attribute 'package(pkg)' does not bind to
one of ancestor packages of module pkg
----
The ancestor test should be made aware of package modules.
We could consider to change the default meaning of `package` (w/o qualified
name) in a package module, to mean exactly the current package, but could also
keep the current implementation to mean the ancestor package and only allow to
use the current package with a qualified name.
--
More information about the Digitalmars-d-bugs
mailing list