I'm trying to use NVI idiom but i keep getting errors from dmd.

This is my setup:

module test;

import std.stdio;

interface IBase {
        void foo();
        void bar();
}

interface IBar : IBase {
        final void bar() {
                writefln("IBar.bar()");
        }
}

class Foo : IBar {

        void foo() {
                writefln("Foo.foo()");
        }
}

void main() {

        Foo foo = new Foo();
        foo.foo();
}

When I try to compile it i get "test.d(16): Error: class test.Foo
interface function IBar.bar isn't implemented"

And if I try to define bar() in Foo i receive "test.d(22): Error:
function test.Foo.bar cannot override final function
IBar.test.IBar.bar"
which is expected since IBar.bar() is final.

So, am I missing some point about NVIs here or is it just not yet
implemented in dmd?

Reply via email to