[Issue 605] New: Problem w/ function overload resultion and enums.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 26 12:09:40 PST 2006


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 at digitalmars.com
        ReportedBy: godaves at 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
}


-- 




More information about the Digitalmars-d-bugs mailing list