Summary: "private" attribute breaks "override"
           Product: D
           Version: 1.051
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, wrong-code
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2009-12-05 23:01:54 PST ---
The compiler should error on the following code. Even though "override" is
specified, nothing is overridden.

This should either run fine (without triggering the assertion), or not compile.
The first if "override" disregards the current visibility attribute of the
scope, and the second if "foo" is considered a private and thus non-virtual
function. (I do not know which one, so I tagged the bug with both keywords;
please remove this when it's known what should happen.)


abstract class A {
    void foo() {
        assert(false); // should be called instead!

class B : A {
private:  //if you comment this out, it works

    void something() {

    override void foo() {
        //never called, which is a bug

void main() {
    A x = new B();;

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to