Bug 20729 – Circular import causes "not visible" error

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-04-12T01:51:29Z
Last change time
2024-12-13T19:08:04Z
Assigned to
No Owner
Creator
andy-hanson
Moved to GitHub: dmd#19690 →

Comments

Comment #0 by andy-hanson — 2020-04-12T01:51:29Z
**app.d**: ``` module app; import core.stdc.math : fabs; import b : b; void fabs(const string s) { } void main() { } ``` **b.d**: ``` module b; import app : fabs; void b() { fabs(""); } ``` Compile with `dmd app.d`. There should be no compile errors. Instead there is: ``` b.d(3): Error: module app member fabs is not visible from module b ``` There is no such error is you remove the `fabs` import in `app.d` or you move the import in `b.d` into `void b`. There is also no such error if you compile using `dmd b.d app.d` instead.
Comment #1 by robert.schadek — 2024-12-13T19:08:04Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19690 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB