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

[diagnostic] Name suggest for override should only list virtual functions #19613

Open
dlangBugzillaToGithub opened this issue Aug 23, 2019 · 0 comments

Comments

@dlangBugzillaToGithub
Copy link

Adam D. Ruppe (@adamdruppe) reported this on 2019-08-23T13:40:19Z

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

Description

Easier to describe in code:

---
class A {
        final void a(int) {}
        void a(string) {}
}
class B : A {
        override void a(int) {}
}
---

Yields:

Error: function bug.B.a cannot override final function bug.A.a
Error: function void bug.B.a(int) does not override any function, did you mean to override void bug.A.a(int)?


I didn't mean to override a(int) because it is final, the compiler error message could make sure it is at least suggesting a relevant virtual function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants