www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10361] New: Cross-module overloading conflict between unordered functions

http://d.puremagic.com/issues/show_bug.cgi?id=10361

           Summary: Cross-module overloading conflict between unordered
                    functions
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: tommitissari hotmail.com


--- Comment #0 from Tommi <tommitissari hotmail.com> 2013-06-14 22:37:45 PDT ---
It seems that during function partial ordering the compiler thinks that an
int-based enum is implicitly convertible to char:

---------
module a;

void foo(char) { }

---------
module b;

enum MyEnum : int { _ }

void foo(MyEnum) { }

---------
module main;

import a;
import b;

void main()
{
    foo(char.init);
    foo(MyEnum.init); // [1]
}

// 1) Error: b.foo at b.d(5) conflicts with a.foo at a.d(3)

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