November 07, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1646

           Summary: method overloaded on delegate and function matches both
                    in certain cases
           Product: D
           Version: 2.007
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: schveiguy@yahoo.com


The following code produces the issue:

class A
{
  void f1(void delegate() dg)
  {
  }

  void f1(void function() dg)
  {
  }
}

class C
{
  this()
  {
    A a = new A;
    a.f1(&x);
  }
  void x()
  {
  }
}

The call to f1 should only match the delegate version because x requires a context pointer.  This was the behavior on D 1.0.

A workaround exists, if you change the line to:

a.f1(&this.x);


-- 

July 10, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1646


schveiguy@yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from schveiguy@yahoo.com  2008-07-10 12:48 -------
This issue appears to be fixed in D 2.015 and 2.016


--