[Issue 5742] New: Delegate Covariance

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 16 10:04:46 PDT 2011


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 at puremagic.com
        ReportedBy: dsimcha at yahoo.com


--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2011-03-16 10:01:36 PDT ---
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: -------


More information about the Digitalmars-d-bugs mailing list