Re: [Vala] Warnings when subclassing classes without public constructor
- From: Abderrahim Kitouni <a kitouni gmail com>
- To: Mike Massonnet <mmassonnet gmail com>
- Cc: "vala-list gnome org" <vala-list gnome org>
- Subject: Re: [Vala] Warnings when subclassing classes without public constructor
- Date: Mon, 21 Dec 2009 18:34:13 +0100
Hi,
2009/12/20 Mike Massonnet <mmassonnet gmail com>:
Hello,
I had like to know if there exists a way to avoid a warning when
compiling with valac classes that subclass classes without public
constructors. As an example, Gtk.Bin doesn't have any public
constructor but it is still valid to subclass it. The warning printed
is the following:
warning: unable to chain up to private base constructor
Chain up to a class that has a public, non [CCode
(has_construct_function=false)] constructor.
Please note that in Vala, you don't need to chain up to direct base
class, you may for example chain up directly to Object (this is the
preferred way to set construct properties).
something like this should solve your problem :
public MyClass() {
Object();
}
HTH,
Abderrahim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]