Bug 13868 – Types with the same name in different packages produce poor diagnostics

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-12-16T00:33:58Z
Last change time
2024-12-13T18:38:26Z
Assigned to
No Owner
Creator
Paul O'Neil
Moved to GitHub: dmd#17691 →

Comments

Comment #0 by redballoon36 — 2014-12-16T00:33:58Z
Consider the following modules: first.d: struct A { } second.d struct A { } third.d: import first; import second; void main() { first.A a; second.a b; a = b; } Compiling these three files together produces the following error message: Error: cannot implicitly convert expression (b) of type A to A When it is not immediately clear that a and b come from different packages, this error message is not helpful. When the names of the types are similar, it would be helpful to have the package / module name emitted in the diagnostic.
Comment #1 by ketmar — 2014-12-16T08:20:00Z
i dare to say that it will be helpful to emit module name for any symbol that is not declared in the current module. 'cause simply importing std.string can cause this: http://forum.dlang.org/thread/[email protected] and it's not obvious where that `count` came from.
Comment #2 by robert.schadek — 2024-12-13T18:38:26Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17691 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB