[Issue 10007] New: 16 hours agofunction overrides but is not covariant

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 29 05:20:04 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10007

           Summary: 16 hours agofunction overrides but is not covariant
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: rswhite4 at googlemail.com


--- Comment #0 from rswhite4 at googlemail.com 2013-04-29 05:20:00 PDT ---
----
import std.stdio;

struct A { }

interface IFoo {
    void bar(ref const A);
}

class Foo : IFoo {
    void bar(ref const A a) {

    }

    void bar(const A a) {
        return this.bar(a);
    }
}
----
prints:

Error: function c517.Foo.bar of type void(const(A) a) overrides 
but is not covariant with c517.IFoo.bar of type void(ref const(A))

-- 
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