Bug 10411 – Private aliases introduce conflicts and cause bad diagnostics

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-18T20:07:00Z
Last change time
2013-09-05T16:12:42Z
Keywords
rejects-valid
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2013-06-18T20:07:08Z
----- module foo; private { import std.stdio; alias println = writeln; } ----- ----- module bar; void println(string file = __FILE__, size_t line = __LINE__, Args...)(Args args) { } ----- ----- module main; import foo; import bar; void main() { println(""); } ----- $ C:\dev\code\d_code\conflict>dmd main.d > DMD v2.064 DEBUG > main.d(8): Error: bar.println!("main.d", 8u, string).println at bar.d(3) > conflicts with std.stdio.writeln!(string).writeln at C:\dmd-git\dmd2\windows > \bin\..\..\src\phobos\std\stdio.d(1728) Note how a *private* alias in 'foo' ends up causing a conflict in the importing module, and also note the horrible diagnostic: it doesn't tell us which module caused the conflict ('foo' is not mentioned anywhere).
Comment #1 by dlang-bugzilla — 2013-09-05T16:12:42Z
*** This issue has been marked as a duplicate of issue 1238 ***