www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5742] New: Delegate Covariance

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

           Summary: Delegate Covariance
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com



class A {}
class B : A {}

void main() {
    A delegate() foo;
    B delegate() bar;
    foo = bar;
}

Error: cannot implicitly convert expression (bar) of type B delegate() to A
delegate()

Is there any reason why this shouldn't work?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 16 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5742


Steven Schveighoffer <schveiguy yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |schveiguy yahoo.com
         Resolution|                            |DUPLICATE



10:08:31 PDT ---
*** This issue has been marked as a duplicate of issue 3180 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 16 2011