Re: [Vala] Another interface implementation problem



Jürg Billeter schrieb:
Hi Dominique,

On Sam, 2006-09-02 at 18:38 +0200, Dominique Würtz wrote:
I'm struggling with the following hierarchy provided by GooCanvas (which I'm creating bindings for):

interface Item {
    public abstract View create_view ();
}

abstract class SimpleItem : Item {
    // This does _not_ implement create_view ()
}

class MyItem : SimpleItem {
    public override View create_view ();
}

Vala complains that it can't find I prototype for create_view () in SimpleItem which can be overridden. Out of curiosity I fed this hierarchy into the Mono C# compiler and found that C# requires you to implement the complete interface in SimpleItem. However, GooCanvas relies on these relaxed inheritance policies, so my question is, could Vala be modified to accept abstract classes implementing interfaces only partly?

Yes, it makes sense to add this functionality to Vala. There is an easy
Good to hear!

workaround available if you only need it in bindings at the moment: You
can just remove the overriding method from the VAPI file as the compiler
doesn't really care which classes override which methods in bindings
Unfortunately no, because MyItem is not part of the bindings, but would be a custom implementation by an app (sorry, I wasn't clear here).

Dominique





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]