Bug 10688 – Misleading error message when attempting a "private override"

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-21T02:18:00Z
Last change time
2013-07-25T12:37:19Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
Marco.Leise

Comments

Comment #0 by Marco.Leise — 2013-07-21T02:18:29Z
class Bar: Foo { private: override void func() {} } This doesn't compile and print "cannot override a non-virtual function". It took me a while to realize that the problem (in a larger class) was not in the base class, but in the attributes of the override. What about error messages like: "cannot reduce visibility of override" or "overrides must not be private"
Comment #1 by henning — 2013-07-24T04:14:44Z
Comment #2 by github-bugzilla — 2013-07-25T12:37:10Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6663240705598be8ffb16d2b2a88da7246bcd599 fix issue 10688 - Misleading error message when attempting a "private override" https://github.com/D-Programming-Language/dmd/commit/e0e73f6198f0e1cb5344d67f842ba9b74ec9ff6a Merge pull request #2376 from hpohl/10688 [enh] fix issue 10688 - Misleading error message when attempting a "private override"