Bug 20975 – Symbol conflict error message refers to aliased symbol instead of the alias when imported

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-06-25T02:33:19Z
Last change time
2024-12-13T19:09:43Z
Keywords
diagnostic
Assigned to
No Owner
Creator
elpenguino+D
See also
https://issues.dlang.org/show_bug.cgi?id=4917
Moved to GitHub: dmd#17967 →

Comments

Comment #0 by elpenguino+D — 2020-06-25T02:33:19Z
test.d: ``` import bar; import foo; void main() { int a = x; } ``` bar.d: ``` int a; alias x = a; ``` foo.d: ``` int a; alias x = a; ``` Currently, this produces `Error: variable `bar.a` at bar.d(1) conflicts with variable `foo.a` at foo.d(1)`. It should refer to foo.x and bar.x instead, since they're the real conflict. This seems to be similar to issue 4917.
Comment #1 by robert.schadek — 2024-12-13T19:09:43Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17967 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB