On 10/26/20 9:19 PM, Ruby The Roobster wrote:
Following code doesn't work(it's not the actual code but it represents it). Is there some rule about function overrides that I don't know about?

...
The error I keep getting no matter what says: Error: Multiple Overrides of Same Function. Anybody know what I should do?

It works for me.

The "shorten" link on run.dlang.io no longer works, but here is a working example:

```
import std;

class A {
    public override string toString() {
        return "a";
    }
}

class B : A {
    public override string toString() {
            return "b";
    }
}

void main()
{
    A a = new A();
    B b = new B();
    writeln(a);
    writeln(b);
}
```

Reply via email to