[Issue 9784] New: Fail to use auto when implementing class interface methods

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 22 03:34:11 PDT 2013


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

           Summary: Fail to use auto when implementing class interface
                    methods
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: yazan.dabain at gmail.com


--- Comment #0 from yazan.dabain at gmail.com 2013-03-22 03:34:10 PDT ---
Example:

interface IFoo {
  int foo();
}

class Foo : IFoo {
  auto foo() {
    return 0;
  }
}

void main(){}

Output:

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

Changing auto to int resolves the issue.

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