Re: [Vala] Virtual methods in interfaces
- From: Abderrahim Kitouni <a kitouni gmail com>
- To: James Moschou <james moschou gmail com>
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] Virtual methods in interfaces
- Date: Tue, 25 Jan 2011 14:06:24 +0100
Hi,
في ث، 25-01-2011 عند 21:35 +1030 ، كتب James Moschou:
Is is possible to mark methods as virtual in interfaces, as a
mechanism of providing default implementations?
If I do
interface Interface {
public virtual void function () {
// Default
}
}
class Class : Object, Interface {
public override void function () {
// Custom
}
}
The compiler says that no method to override was found.
but if you remove the override keyword, it works ;-)
So now the question is : is this intentional? I always thought that you
don't need override when implementing an abstract method (and need
override when there is already an implementation), but it seems I was
wrong. This probably needs an answer from Jürg (and the rationale to be
added somewhere in the documentation).
HTH,
Abderrahim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]