www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 605] New: Problem w/ function overload resultion and enums.

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

           Summary: Problem w/ function overload resultion and enums.
           Product: D
           Version: 0.175
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: godaves yahoo.com


The following code shows the problem, which only arises when the struct
sockaddr_in definition happens to be included. Otherwise the workaround is an
explicit cast.

void main()
{
//    foo f = new foo(cast(AddressFamily)AddressFamily.INET);
    foo f = new foo(AddressFamily.INET);
}

class foo
{
    this(AddressFamily f)
    {
    }
}

// from std.c.linux.socket
enum: int
{
        AF_INET =       2
}

// from std.c.linux.socket
struct sockaddr_in
{
        short sin_family = AF_INET;
}

// from std.socket
enum AddressFamily: int
{
        INET =       AF_INET
}


-- 
Nov 26 2006
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=605


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |FIXED


--- Comment #1 from Don <clugdbug yahoo.com.au> 2010-01-19 08:33:11 PST ---
This was fixed between 0.175 and 1.000.
(The example works in 1.053, but not in 1.054; however, that's an unrelated
regression).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 19 2010