[Issue 21366] New: `private` ignored for circular imports
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Nov 7 02:46:46 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21366
Issue ID: 21366
Summary: `private` ignored for circular imports
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:**
```
import std.stdio : writeln;
import b : two;
void main() {
writeln(two());
}
private int one() {
return 1;
}
```
**b.d:**
```
module b;
import app : one;
int two() {
return one() + one();
}
```
Module `b` should not be allowed to import `one`, but it compiles without
error. (Ran `dmd app.d b.d`.)
Tested with `dmd --version` of `DMD64 D Compiler v2.094.1`.
--
More information about the Digitalmars-d-bugs
mailing list