Fixes bug 606202.
CCodeExpression cexpr = (CCodeExpression) assignment.right.ccodenode;
if (!prop.no_accessor_method) {
- if (prop.property_type.is_real_struct_type ()) {
+ if (prop.property_type.is_real_non_null_struct_type ()) {
cexpr = get_address_of_expression (assignment.right, cexpr);
}
}
// Property access to real struct types is handled differently
// The value is returned by out parameter
- if (base_property.property_type.is_real_struct_type ()) {
+ if (base_property.property_type.is_real_non_null_struct_type ()) {
var ccomma = new CCodeCommaExpression ();
var temp_var = get_temp_variable (base_property.get_accessor.value_type);
var ctemp = get_variable_cexpression (temp_var.name);
structs/bug530605.vala \
structs/bug583603.vala \
structs/bug595587.vala \
+ structs/bug606202.vala \
delegates/delegates.vala \
delegates/bug595610.vala \
delegates/bug595639.vala \
--- /dev/null
+struct Foo {
+ string s;
+
+ public Foo (string s) {
+ this.s = s;
+ }
+}
+
+class Bar : Object {
+ public Foo? foo { get; set; }
+}
+
+void main () {
+ var bar = new Bar ();
+ var foo = Foo ("hello");
+ bar.foo = foo;
+ assert (bar.foo.s == "hello");
+}