[Issue 20975] New: Symbol conflict error message refers to aliased symbol instead of the alias when imported

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 25 02:33:19 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20975

          Issue ID: 20975
           Summary: Symbol conflict error message refers to aliased symbol
                    instead of the alias when imported
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: elpenguino+D at gmail.com

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.

--


More information about the Digitalmars-d-bugs mailing list