[Issue 8318] New: Cannot override a method with inferred return type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 29 12:54:31 PDT 2012


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

           Summary: Cannot override a method with inferred return type
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: doob at me.com


--- Comment #0 from Jacob Carlborg <doob at me.com> 2012-06-29 12:57:04 PDT ---
The following code fails to compile:

class Foo {
    auto foo() {
        return "Foo.foo";
    }
}

class Bar : Foo {
    override auto foo() {
        return "Bar.foo";
    }
}

void main() {}

It doesn't matter if "override" is specified or not. The error message received
is:

Error: function main.Bar.foo of type () overrides but is not covariant with
main.Foo.foo of type ()

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