[Issue 18432] alias x = x where x is an imported symbol should result in an error
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 21 08:23:38 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18432
Mike Franklin <slavo5150 at yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |slavo5150 at yahoo.com
--- Comment #6 from Mike Franklin <slavo5150 at yahoo.com> ---
Something that might be contributing to the problem is the compiler currently
allows selectively importing private aliases:
--- moduleA.d
module moduleA;
private int i;
private alias I = i;
static this()
{
i = 10;
}
--- main.d
import std.stdio;
import moduleA : I;
void main()
{
writeln(I);
}
That compiles and prints "10". The statement `import moduleA : I;` should fail
because `I` is private.
--
More information about the Digitalmars-d-bugs
mailing list