D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21829 - `private` is ignored when a public overload exists
Summary: `private` is ignored when a public overload exists
Status: RESOLVED DUPLICATE of issue 3254
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid, pull
: 21366 22083 22132 (view as issue list)
Depends on:
Blocks:
 
Reported: 2021-04-15 13:17 UTC by Bastiaan Veelo
Modified: 2022-09-08 06:48 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Bastiaan Veelo 2021-04-15 13:17:20 UTC
--- test.d
void main()
{
    import bar;
    foo(1); // Compiles, violating private.
}
--- bar.d
import std.stdio;

private void foo(int i)
{
    writeln("Private!!!");
}
void foo()
{
    writeln("Public");
}
Comment 1 Dennis 2021-07-20 09:58:26 UTC
*** Issue 22132 has been marked as a duplicate of this issue. ***
Comment 2 Dlang Bot 2021-11-03 11:32:23 UTC
@RazvanN7 created dlang/dmd pull request #13257 "Fix Issue 21829, Fix Issue 21366 -  is ignored when a public overload exists" fixing this issue:

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

https://github.com/dlang/dmd/pull/13257
Comment 3 RazvanN 2022-09-08 06:47:42 UTC
*** Issue 21366 has been marked as a duplicate of this issue. ***
Comment 4 RazvanN 2022-09-08 06:48:12 UTC
*** Issue 22083 has been marked as a duplicate of this issue. ***
Comment 5 RazvanN 2022-09-08 06:48:57 UTC

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