After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 622119 - Not marking property as construct and using it with GObject-style construction doesn't raise any warnings or errors
Not marking property as construct and using it with GObject-style constructio...
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator: GObject
0.8.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-19 18:55 UTC by Urban Skudnik
Modified: 2010-10-16 12:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Urban Skudnik 2010-06-19 18:55:18 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;
}
Comment 1 Jürg Billeter 2010-10-16 12:19:51 UTC
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.