D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21366 - `private` ignored for circular imports
Summary: `private` ignored for circular imports
Status: RESOLVED DUPLICATE of issue 21829
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-11-07 02:46 UTC by andy-hanson
Modified: 2022-09-08 06:47 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description andy-hanson 2020-11-07 02:46:46 UTC
**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`.
Comment 1 Dlang Bot 2021-11-03 11:34:36 UTC
@RazvanN7 updated dlang/dmd pull request #13257 "Fix Issue 21829, Fix Issue 21366 -  is ignored when a public overload exists" fixing this issue:

- Fix Issues 21829, 21366 -  is ignored when a public overload exists

https://github.com/dlang/dmd/pull/13257
Comment 2 RazvanN 2022-09-08 06:47:42 UTC

*** This issue has been marked as a duplicate of issue 21829 ***