Hi dlang community,

Just started to learn D using Visual Studio 2007, latest VisualD (VisualD-v0.51.0-dmd-2.090.0-ldc2-1.19.0) and "The D Programming Language" by Andrei Alexandrescu.

I am trying to run most of the examples and had a surprise at chapter 1.6.1 "More Statistics. Inheritance" with the following code:

interface Stat {
    void accumulate(double x);
    ...
}

class IncrementalStat : Stat {
    ...
    abstract void accumulate(double x);
    ...
}

class Min : IncrementalStat {
    ...
    void accumulate(double x) { ... }
    ...
}

In class "Min" definition I am receiving this error: "cannot implicitly override base class method `IncrementalStat.accumulate` with `Min.accumulate`; add `override` attribute"

After I update "Min" class to << override void accumulate(double x) >> everything works fine.
Can anybody clarify where is the problem.

Thanks in advance,
Claudiu

Reply via email to