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 606202 - Support nullable struct as property type
Support nullable struct as property type
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Structs
0.7.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-06 13:39 UTC by Étienne Bersac
Modified: 2010-01-08 20:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Étienne Bersac 2010-01-06 13:39:33 UTC
Hi,

Using nullable struct property leads to GCC error.

Case :

public struct TestStruct {
	public string label;
}

class TestClass : Object {
	public weak TestStruct? strukt {get; set;}
}

public int main(string[] args) {
	var test = new TestClass();
	var strukt = TestStruct();
	test.strukt = strukt;
	return 0;
}

Error :
test.vala.c:187: error: lvalue required as unary ‘&’ operand
error: cc exited with status 256

Thanks,
Étienne
Comment 1 Jürg Billeter 2010-01-08 20:24:27 UTC
commit 7cd9bc328dc3ec3b555a6ea9d2562877beef4708
Author: Jürg Billeter <j@bitron.ch>
Date:   Fri Jan 8 21:22:09 2010 +0100

    Fix nullable struct properties
    
    Fixes bug 606202.