Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behavior overriding functions from abstract classes that implement interfaces. #19340

Open
dlangBugzillaToGithub opened this issue Dec 7, 2017 · 0 comments
Labels

Comments

@dlangBugzillaToGithub
Copy link

IM reported this on 2017-12-07T07:16:34Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=18041

Description

This issue was discussed here in the forum: https://forum.dlang.org/thread/wvysznguwwapxdcjtkge@forum.dlang.org

I will repeat my description from there:

Assume the following:


interface IFace {
  void foo();
  void bar();
}

abstract class A : IFace {
  override void foo() {}
}

class B : A {
  override void bar() {}
}


This fails to compile with the following message:

--->>>
function bar does not override any function, did you mean to override 'IFace.bar()'?
<<<---

So `override` works for A::foo(), but doesn't work for B::bar(). This is inconsistent and confusing. I would expect that `override` works for both cases. Please fix. Thank you.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant