[Issue 22889] Selective import shadows local variable
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Mar 17 14:04:07 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22889
--- Comment #3 from Paul Backus <snarwin+bugzilla at gmail.com> ---
Note that the following similar program does NOT compile:
--- lib.d
int x = 1;
--- main.d
void main()
{
int x = 2;
{
import lib;
alias x = lib.x;
assert(x == 1);
}
}
---
The error given is
---
main.d(6): Error: alias `x` is shadowing variable `main.main.x`
---
--
More information about the Digitalmars-d-bugs
mailing list