[Issue 20729] New: Circular import causes "not visible" error
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Apr 12 01:51:29 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=20729
Issue ID: 20729
Summary: Circular import causes "not visible" error
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: andy.pj.hanson at gmail.com
**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.
--
More information about the Digitalmars-d-bugs
mailing list