Re: [Vala] Interfaces and Mixins



On Tue, Jun 15, 2010 at 4:00 PM, tecywiz121 <tecywiz121 hotmail com> wrote:

On Tue, 2010-06-15 at 14:50 -0700, Robert Powell wrote:
On Sat, Jun 12, 2010 at 7:03 AM, tecywiz121 <tecywiz121 hotmail com>

You can access Entity.flush by casting this to an Entity.  I think
you'll find that when you refer to the object you will receive GObject
warnings about cannot add interface type 'Entity'.  Even without the
name collision of flush, this GObject warning will still occur.

Wouldn't the following code (not sure, haven't tried) just recurse
infinitely?

public object Bob : Object, Flushable, Entity
{
   public void flush()
   {
       ((Entity)this).flush();
    }
}


As long as Entity's implementation of flush doesn't call Bob's
implementation of flush, I don't see why it would recurse.


Deriving interfaces from interfaces is definitely broken.  You might
want to submit a bug.

Actually in my other interfaces, it works fine.  I'm just not sure if
I'm allowed to override a method declared in Flushable in Entity.


Do your other interfaces derive from another interface?  I think that is
where trouble lies, or used to lie.

Rob


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