GNOME Bugzilla – Bug 773956
Add check that a property has a get and/or set
Last modified: 2016-11-08 08:34:34 UTC
The following code compiles: class Foo : Object { public string my_property { default = "none"; } } void main () { new Foo (); } but produces the runtime critical error: GLib-GObject-CRITICAL **: g_object_class_install_property: assertion 'pspec->flags & (G_PARAM_READABLE | G_PARAM_WRITABLE)' failed The same for: class Foo : Object { public string my_property {} } void main () { new Foo (); }
Created attachment 339278 [details] [review] codegen: Require public get or set for properties
Created attachment 339295 [details] [review] Add a check for an accessor or mutator to valaproperty.vala This adds the check to the semantic analyzer instead of the code generator.