You can try code below as solution/workaround.
class Foo : GLib.Object
{
public virtual signal void func()
{
message("Foo");
}
}
class Bar : Foo
{
public override void func()
{
message("Bar");
}
}
int main()
{
Foo foo = new Bar();
foo.func.connect(() => { message("Main"); });
foo.func();
return 0;
}
Derek Dai
On Sun, Dec 16, 2012 at 8:00 PM, <[email protected]> wrote:
> Send vala-list mailing list submissions to
> [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mail.gnome.org/mailman/listinfo/vala-list
> or, via email, send a message with subject or body 'help' to
> [email protected]
>
> You can reach the person managing the list at
> [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of vala-list digest..."
>
>
> Today's Topics:
>
> 1. Defining new virtual signal is possible, but overring it
> isn't. (Tal Hadad)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 15 Dec 2012 21:00:24 +0200
> From: Tal Hadad <[email protected]>
> To: Vala Mail List <[email protected]>
> Subject: [Vala] Defining new virtual signal is possible, but
> overring
> it isn't.
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="windows-1255"
>
>
> When I try to:
> public class A : GLib.Object {
> public virtual signal void func () {}
> }
>
>
> public class B : A {
>
> public override void func () {}
>
> }
>
> I get an error from Valac:
> error: B.func: no suitable method found to override
>
> I'm using Vala 0.16.1
>
> I think that this is a critical bug in Vala, or my code is wrong?
>
> Thanks,
> Tal
>
>
> ------------------------------
>
> _______________________________________________
> vala-list mailing list
> [email protected]
> https://mail.gnome.org/mailman/listinfo/vala-list
>
>
> End of vala-list Digest, Vol 61, Issue 7
> ****************************************
>
_______________________________________________
vala-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/vala-list