Summary: wrong error "override cannot be applied to variable"
                    in CTFE forward reference
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Don <> 2011-11-07 01:24:26 PST ---
Applies to both D1 and D2, at least as far back as 2.040. It's a forward
reference error, triggered in this case by CTFE.

class Base6900
    void foo() {}

class Derived6900: Base6900
    override void foo() { }

int test6900()
    Derived6900 d = new Derived6900;  // for github HEAD
    // Derived6900 d = null;   // for older versions;
    return 1;

static assert(test6900());
test.d(8): Error: variable override cannot be applied
to variable
test.d(15):        called from here:
test.d(19):        called from here: test6900()
test.d(19): Error: static assert  (test6900()) is not evaluatable at compile

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

Reply via email to