GNOME Bugzilla – Bug 622119
Not marking property as construct and using it with GObject-style construction doesn't raise any warnings or errors
Last modified: 2010-10-16 12:19:51 UTC
Using {get; construct;} returns that Time does not support construct properties, but declaring a variable of type Time with {get; set;} returns no error at compilation time when one constructs that property with Object(property: value). Only at execution a warning is issued: (process:3489): GLib-GObject-WARNING **: IA__g_object_new_valist: object class `TimeTestCase' has no property named `time' Example code: public class TimeTestCase : Object { public GLib.Time time {get; set;} public TimeTestCase(GLib.Time time_in) { Object(time: time_in); } public void test(){ stdout.printf("%s", time.format("%c")); } } int main(string[] args) { time_t timestamp = 1234151912; Time ttime = Time.gm(timestamp); var ttc = new TimeTestCase(ttime); ttc.test(); return 0; }
commit 644cca0e443f216e8e5e26fab14bb6428e70cda8 Author: Jürg Billeter <j@bitron.ch> Date: Sat Oct 16 14:18:08 2010 +0200 GObject: Check for incompatible properties in constructor chain up Fixes bug 622119.