Bug 21895 – Module in package incorrectly accessible when it was not explicitly imported

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-05-06T08:16:35Z
Last change time
2024-12-13T19:16:12Z
Assigned to
No Owner
Creator
Eyal
Moved to GitHub: dmd#19921 →

Comments

Comment #0 by eyal — 2021-05-06T08:16:35Z
With the following separate modules defined: ----------------- module pkg.a; ----------------- module pkg.b; import pkg.a; ----------------- module test; import pkg.b; // pkg.a is now incorrectly usable, without being imported ----------------- If we remove the import of pkg.a in pkg.b, then module test suddenly does need to import pkg.a. Whether or not 'pkg.b' imports 'pkg.a' is an implementation detail of 'pkg.b', so should not affect module 'test's accessibility of 'pkg.a'.
Comment #1 by robert.schadek — 2024-12-13T19:16:12Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19921 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB