Bug 20462 – [SPEC] Clearly document rules of package attribute on module.d vs. package.d file names

Status
NEW
Severity
enhancement
Priority
P4
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-12-22T11:38:39Z
Last change time
2024-12-15T15:25:35Z
Assigned to
No Owner
Creator
Iain Buclaw
Moved to GitHub: dlang.org#4100 →

Comments

Comment #0 by ibuclaw — 2019-12-22T11:38:39Z
Notably be more explicit in the spec that as soon as you convert a module into a package.d source, then *that* now becomes the innermost package. i.e: --- // (std/internal.a.d): package = stdx module stdx.internal.a; import stdx.b; void main() { foo(); } --- --- // (stdx/b.d): package = stdx // (stdx/b/package.d): package = stdx.b module stdx.b; package void foo() { } --- In one directory structure, 'foo' is visible from stdx.internal.a, in another, 'foo' becomes undefined, and so you will need to explicitly say which package you want it to be visible from in order to compile. --- // (stdx/b/package.d): package = stdx.b module stdx.b; package(stdx) void foo() { } ---
Comment #1 by robert.schadek — 2024-12-15T15:25:35Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/4100 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB