www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10411] New: Private aliases introduce conflicts and cause bad diagnostics

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10411

           Summary: Private aliases introduce conflicts and cause bad
                    diagnostics
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-06-18
20:07:08 PDT ---
-----
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). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 18 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10411


Vladimir Panteleev <thecybershadow gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |thecybershadow gmail.com
         Resolution|                            |DUPLICATE


--- Comment #1 from Vladimir Panteleev <thecybershadow gmail.com> 2013-09-06
02:12:42 EEST ---
*** This issue has been marked as a duplicate of issue 1238 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 05 2013