[Issue 21001] New: Private alias becomes public if used before declaration
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jul 1 12:33:41 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21001
Issue ID: 21001
Summary: Private alias becomes public if used before
declaration
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: default_357-line at yahoo.de
Consider the following code ( https://run.dlang.io/is/mn75WZ ):
--- a.d
module a;
private struct S { Alias member; }
private alias Alias = int;
--- b.d
module b;
import a;
void main() { Alias var; }
--
Clearly this shouldn't ought to compile, but it does. Alias is publically
visible as an export from a, despite being declared private.
This only seems to happen if S comes before Alias. Somehow, using the symbol
early prevents it from being marked private.
--
More information about the Digitalmars-d-bugs
mailing list