Re: [Vala] interface and inherance (vala 0.7.5)



Hello,

Frederic LEGER <fredator26    > writes:
I found a problem with the interface and the inherance. Possibly the problem
is mine, not in the compiler.
Anyway that would have been great if it was working as I was expecting...

some days ago I created the class  Rectangle, and interface Affichable...
today, I created the class  RectangleG which derives from Rectangle and
implements the interface Affichable

And stupidly, Rectangle implemented a few methods of the Affichable
interface..... that raises in a strange case for me....

I don't think any non-dynamic language works as you expect, that is
automatically use methods defined in base class as interface implementation.
You always have to overload the methods (trivially calling the base
implementation) to have the class accepted as implementing the interface.

Now what would be good is if vala supported explicit interface implementations
(i.e. you could have the interface method implemented differently than
method of the same name of the class itself -- it's perfectly doable with
GObject), but that's another matter.

Regards,
Jan




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