]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Inherit important attributes for Property backing field
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 16 Apr 2024 11:01:23 +0000 (13:01 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 19 Apr 2024 10:23:36 +0000 (12:23 +0200)
tests/methods/array-length-type.c-expected
tests/objects/property-array.c-expected
tests/objects/property-delegate.c-expected
tests/objects/property-strv-noaccessor.c-expected
vala/valaproperty.vala

index 9decc7484fe7adb2ca57056516add1cba339399b..b0b5c193c1ff6fc379556b6010a70b6d0debcd8f 100644 (file)
@@ -90,8 +90,8 @@ struct _FooPrivate {
        gint _manam_length1;
        gint __manam_size_;
        gint* _manar;
-       gint _manar_length1;
-       gint __manar_size_;
+       guint8 _manar_length1;
+       guint8 __manar_size_;
 };
 
 struct _ParamSpecFoo {
index 6fea354e81015acb0b3bf1f39bc10d9eea7be512..31cdcd0009c8277c48be07a8455d0470b13b26b5 100644 (file)
@@ -95,17 +95,9 @@ struct _FooPrivate {
        gint _array_v_length1;
        gint __array_v_size_;
        Manam** _array_no_length;
-       gint _array_no_length_length1;
-       gint __array_no_length_size_;
        Manam** _array_no_length_v;
-       gint _array_no_length_v_length1;
-       gint __array_no_length_v_size_;
        gchar** _strv;
-       gint _strv_length1;
-       gint __strv_size_;
        gchar** _strv_v;
-       gint _strv_v_length1;
-       gint __strv_v_size_;
 };
 
 struct _ParamSpecFoo {
@@ -127,17 +119,9 @@ struct _BarClass {
 
 struct _BarPrivate {
        Manam** _array;
-       gint _array_length1;
-       gint __array_size_;
        Manam** _array_v;
-       gint _array_v_length1;
-       gint __array_v_size_;
        gchar** _strv;
-       gint _strv_length1;
-       gint __strv_size_;
        gchar** _strv_v;
-       gint _strv_v_length1;
-       gint __strv_v_size_;
 };
 
 static gint Foo_private_offset;
@@ -450,7 +434,7 @@ foo_get_array_no_length (Foo* self)
        gint _tmp0__length1;
        g_return_val_if_fail (IS_FOO (self), NULL);
        _tmp0_ = self->priv->_array_no_length;
-       _tmp0__length1 = self->priv->_array_no_length_length1;
+       _tmp0__length1 = _vala_array_length (self->priv->_array_no_length);
        result = _tmp0_;
        return result;
 }
@@ -482,10 +466,8 @@ foo_set_array_no_length (Foo* self,
        g_return_if_fail (IS_FOO (self));
        _tmp0_ = (value != NULL) ? _vala_array_dup3 (value, _vala_array_length (value)) : value;
        _tmp0__length1 = _vala_array_length (value);
-       self->priv->_array_no_length = (_vala_array_free (self->priv->_array_no_length, self->priv->_array_no_length_length1, (GDestroyNotify) manam_free), NULL);
+       self->priv->_array_no_length = (_vala_array_free (self->priv->_array_no_length, _vala_array_length (self->priv->_array_no_length), (GDestroyNotify) manam_free), NULL);
        self->priv->_array_no_length = _tmp0_;
-       self->priv->_array_no_length_length1 = _tmp0__length1;
-       self->priv->__array_no_length_size_ = self->priv->_array_no_length_length1;
 }
 
 Manam**
@@ -509,7 +491,7 @@ foo_real_get_array_no_length_v (Foo* base)
        gint _tmp0__length1;
        self = base;
        _tmp0_ = self->priv->_array_no_length_v;
-       _tmp0__length1 = self->priv->_array_no_length_v_length1;
+       _tmp0__length1 = _vala_array_length (self->priv->_array_no_length_v);
        result = _tmp0_;
        return result;
 }
@@ -554,10 +536,8 @@ foo_real_set_array_no_length_v (Foo* base,
        self = base;
        _tmp0_ = (value != NULL) ? _vala_array_dup4 (value, _vala_array_length (value)) : value;
        _tmp0__length1 = _vala_array_length (value);
-       self->priv->_array_no_length_v = (_vala_array_free (self->priv->_array_no_length_v, self->priv->_array_no_length_v_length1, (GDestroyNotify) manam_free), NULL);
+       self->priv->_array_no_length_v = (_vala_array_free (self->priv->_array_no_length_v, _vala_array_length (self->priv->_array_no_length_v), (GDestroyNotify) manam_free), NULL);
        self->priv->_array_no_length_v = _tmp0_;
-       self->priv->_array_no_length_v_length1 = _tmp0__length1;
-       self->priv->__array_no_length_v_size_ = self->priv->_array_no_length_v_length1;
 }
 
 gchar**
@@ -568,7 +548,7 @@ foo_get_strv (Foo* self)
        gint _tmp0__length1;
        g_return_val_if_fail (IS_FOO (self), NULL);
        _tmp0_ = self->priv->_strv;
-       _tmp0__length1 = self->priv->_strv_length1;
+       _tmp0__length1 = _vala_array_length (self->priv->_strv);
        result = _tmp0_;
        return result;
 }
@@ -600,10 +580,8 @@ foo_set_strv (Foo* self,
        g_return_if_fail (IS_FOO (self));
        _tmp0_ = (value != NULL) ? _vala_array_dup5 (value, _vala_array_length (value)) : value;
        _tmp0__length1 = _vala_array_length (value);
-       self->priv->_strv = (_vala_array_free (self->priv->_strv, self->priv->_strv_length1, (GDestroyNotify) g_free), NULL);
+       self->priv->_strv = (_vala_array_free (self->priv->_strv, _vala_array_length (self->priv->_strv), (GDestroyNotify) g_free), NULL);
        self->priv->_strv = _tmp0_;
-       self->priv->_strv_length1 = _tmp0__length1;
-       self->priv->__strv_size_ = self->priv->_strv_length1;
 }
 
 gchar**
@@ -627,7 +605,7 @@ foo_real_get_strv_v (Foo* base)
        gint _tmp0__length1;
        self = base;
        _tmp0_ = self->priv->_strv_v;
-       _tmp0__length1 = self->priv->_strv_v_length1;
+       _tmp0__length1 = _vala_array_length (self->priv->_strv_v);
        result = _tmp0_;
        return result;
 }
@@ -672,10 +650,8 @@ foo_real_set_strv_v (Foo* base,
        self = base;
        _tmp0_ = (value != NULL) ? _vala_array_dup6 (value, _vala_array_length (value)) : value;
        _tmp0__length1 = _vala_array_length (value);
-       self->priv->_strv_v = (_vala_array_free (self->priv->_strv_v, self->priv->_strv_v_length1, (GDestroyNotify) g_free), NULL);
+       self->priv->_strv_v = (_vala_array_free (self->priv->_strv_v, _vala_array_length (self->priv->_strv_v), (GDestroyNotify) g_free), NULL);
        self->priv->_strv_v = _tmp0_;
-       self->priv->_strv_v_length1 = _tmp0__length1;
-       self->priv->__strv_v_size_ = self->priv->_strv_v_length1;
 }
 
 static void
@@ -842,10 +818,10 @@ foo_finalize (Foo * obj)
        g_signal_handlers_destroy (self);
        self->priv->_array = (_vala_array_free (self->priv->_array, self->priv->_array_length1, (GDestroyNotify) manam_free), NULL);
        self->priv->_array_v = (_vala_array_free (self->priv->_array_v, self->priv->_array_v_length1, (GDestroyNotify) manam_free), NULL);
-       self->priv->_array_no_length = (_vala_array_free (self->priv->_array_no_length, self->priv->_array_no_length_length1, (GDestroyNotify) manam_free), NULL);
-       self->priv->_array_no_length_v = (_vala_array_free (self->priv->_array_no_length_v, self->priv->_array_no_length_v_length1, (GDestroyNotify) manam_free), NULL);
-       self->priv->_strv = (_vala_array_free (self->priv->_strv, self->priv->_strv_length1, (GDestroyNotify) g_free), NULL);
-       self->priv->_strv_v = (_vala_array_free (self->priv->_strv_v, self->priv->_strv_v_length1, (GDestroyNotify) g_free), NULL);
+       self->priv->_array_no_length = (_vala_array_free (self->priv->_array_no_length, _vala_array_length (self->priv->_array_no_length), (GDestroyNotify) manam_free), NULL);
+       self->priv->_array_no_length_v = (_vala_array_free (self->priv->_array_no_length_v, _vala_array_length (self->priv->_array_no_length_v), (GDestroyNotify) manam_free), NULL);
+       self->priv->_strv = (_vala_array_free (self->priv->_strv, _vala_array_length (self->priv->_strv), (GDestroyNotify) g_free), NULL);
+       self->priv->_strv_v = (_vala_array_free (self->priv->_strv_v, _vala_array_length (self->priv->_strv_v), (GDestroyNotify) g_free), NULL);
 }
 
 static GType
@@ -920,7 +896,7 @@ bar_get_array (Bar* self)
        gint _tmp0__length1;
        g_return_val_if_fail (IS_BAR (self), NULL);
        _tmp0_ = self->priv->_array;
-       _tmp0__length1 = self->priv->_array_length1;
+       _tmp0__length1 = _vala_array_length (self->priv->_array);
        result = _tmp0_;
        return result;
 }
@@ -955,10 +931,8 @@ bar_set_array (Bar* self,
                gint _tmp0__length1;
                _tmp0_ = (value != NULL) ? _vala_array_dup7 (value, _vala_array_length (value)) : value;
                _tmp0__length1 = _vala_array_length (value);
-               self->priv->_array = (_vala_array_free (self->priv->_array, self->priv->_array_length1, (GDestroyNotify) manam_free), NULL);
+               self->priv->_array = (_vala_array_free (self->priv->_array, _vala_array_length (self->priv->_array), (GDestroyNotify) manam_free), NULL);
                self->priv->_array = _tmp0_;
-               self->priv->_array_length1 = _tmp0__length1;
-               self->priv->__array_size_ = self->priv->_array_length1;
                g_object_notify_by_pspec ((GObject *) self, bar_properties[BAR_ARRAY_PROPERTY]);
        }
 }
@@ -984,7 +958,7 @@ bar_real_get_array_v (Bar* base)
        gint _tmp0__length1;
        self = base;
        _tmp0_ = self->priv->_array_v;
-       _tmp0__length1 = self->priv->_array_v_length1;
+       _tmp0__length1 = _vala_array_length (self->priv->_array_v);
        result = _tmp0_;
        return result;
 }
@@ -1032,10 +1006,8 @@ bar_real_set_array_v (Bar* base,
                gint _tmp0__length1;
                _tmp0_ = (value != NULL) ? _vala_array_dup8 (value, _vala_array_length (value)) : value;
                _tmp0__length1 = _vala_array_length (value);
-               self->priv->_array_v = (_vala_array_free (self->priv->_array_v, self->priv->_array_v_length1, (GDestroyNotify) manam_free), NULL);
+               self->priv->_array_v = (_vala_array_free (self->priv->_array_v, _vala_array_length (self->priv->_array_v), (GDestroyNotify) manam_free), NULL);
                self->priv->_array_v = _tmp0_;
-               self->priv->_array_v_length1 = _tmp0__length1;
-               self->priv->__array_v_size_ = self->priv->_array_v_length1;
                g_object_notify_by_pspec ((GObject *) self, bar_properties[BAR_ARRAY_V_PROPERTY]);
        }
 }
@@ -1048,7 +1020,7 @@ bar_get_strv (Bar* self)
        gint _tmp0__length1;
        g_return_val_if_fail (IS_BAR (self), NULL);
        _tmp0_ = self->priv->_strv;
-       _tmp0__length1 = self->priv->_strv_length1;
+       _tmp0__length1 = _vala_array_length (self->priv->_strv);
        result = _tmp0_;
        return result;
 }
@@ -1083,10 +1055,8 @@ bar_set_strv (Bar* self,
                gint _tmp0__length1;
                _tmp0_ = (value != NULL) ? _vala_array_dup9 (value, _vala_array_length (value)) : value;
                _tmp0__length1 = _vala_array_length (value);
-               self->priv->_strv = (_vala_array_free (self->priv->_strv, self->priv->_strv_length1, (GDestroyNotify) g_free), NULL);
+               self->priv->_strv = (_vala_array_free (self->priv->_strv, _vala_array_length (self->priv->_strv), (GDestroyNotify) g_free), NULL);
                self->priv->_strv = _tmp0_;
-               self->priv->_strv_length1 = _tmp0__length1;
-               self->priv->__strv_size_ = self->priv->_strv_length1;
                g_object_notify_by_pspec ((GObject *) self, bar_properties[BAR_STRV_PROPERTY]);
        }
 }
@@ -1112,7 +1082,7 @@ bar_real_get_strv_v (Bar* base)
        gint _tmp0__length1;
        self = base;
        _tmp0_ = self->priv->_strv_v;
-       _tmp0__length1 = self->priv->_strv_v_length1;
+       _tmp0__length1 = _vala_array_length (self->priv->_strv_v);
        result = _tmp0_;
        return result;
 }
@@ -1160,10 +1130,8 @@ bar_real_set_strv_v (Bar* base,
                gint _tmp0__length1;
                _tmp0_ = (value != NULL) ? _vala_array_dup10 (value, _vala_array_length (value)) : value;
                _tmp0__length1 = _vala_array_length (value);
-               self->priv->_strv_v = (_vala_array_free (self->priv->_strv_v, self->priv->_strv_v_length1, (GDestroyNotify) g_free), NULL);
+               self->priv->_strv_v = (_vala_array_free (self->priv->_strv_v, _vala_array_length (self->priv->_strv_v), (GDestroyNotify) g_free), NULL);
                self->priv->_strv_v = _tmp0_;
-               self->priv->_strv_v_length1 = _tmp0__length1;
-               self->priv->__strv_v_size_ = self->priv->_strv_v_length1;
                g_object_notify_by_pspec ((GObject *) self, bar_properties[BAR_STRV_V_PROPERTY]);
        }
 }
@@ -1199,10 +1167,10 @@ bar_finalize (GObject * obj)
 {
        Bar * self;
        self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BAR, Bar);
-       self->priv->_array = (_vala_array_free (self->priv->_array, self->priv->_array_length1, (GDestroyNotify) manam_free), NULL);
-       self->priv->_array_v = (_vala_array_free (self->priv->_array_v, self->priv->_array_v_length1, (GDestroyNotify) manam_free), NULL);
-       self->priv->_strv = (_vala_array_free (self->priv->_strv, self->priv->_strv_length1, (GDestroyNotify) g_free), NULL);
-       self->priv->_strv_v = (_vala_array_free (self->priv->_strv_v, self->priv->_strv_v_length1, (GDestroyNotify) g_free), NULL);
+       self->priv->_array = (_vala_array_free (self->priv->_array, _vala_array_length (self->priv->_array), (GDestroyNotify) manam_free), NULL);
+       self->priv->_array_v = (_vala_array_free (self->priv->_array_v, _vala_array_length (self->priv->_array_v), (GDestroyNotify) manam_free), NULL);
+       self->priv->_strv = (_vala_array_free (self->priv->_strv, _vala_array_length (self->priv->_strv), (GDestroyNotify) g_free), NULL);
+       self->priv->_strv_v = (_vala_array_free (self->priv->_strv_v, _vala_array_length (self->priv->_strv_v), (GDestroyNotify) g_free), NULL);
        G_OBJECT_CLASS (bar_parent_class)->finalize (obj);
 }
 
index 150540576d5f7494033b0c8ebbd624916e20ffaa..efb7b7cd27162fa8d77cf03917e46e36f13a8db7 100644 (file)
@@ -86,11 +86,7 @@ struct _FooPrivate {
        gpointer _deleg_v_target;
        GDestroyNotify _deleg_v_target_destroy_notify;
        Manam _deleg_no_target;
-       gpointer _deleg_no_target_target;
-       GDestroyNotify _deleg_no_target_target_destroy_notify;
        Manam _deleg_no_target_v;
-       gpointer _deleg_no_target_v_target;
-       GDestroyNotify _deleg_no_target_v_target_destroy_notify;
 };
 
 struct _ParamSpecFoo {
@@ -110,11 +106,7 @@ struct _BarClass {
 
 struct _BarPrivate {
        Manam _deleg;
-       gpointer _deleg_target;
-       GDestroyNotify _deleg_target_destroy_notify;
        Manam _deleg_v;
-       gpointer _deleg_v_target;
-       GDestroyNotify _deleg_v_target_destroy_notify;
 };
 
 static gint Foo_private_offset;
@@ -303,7 +295,7 @@ foo_get_deleg_no_target (Foo* self)
        gpointer _tmp0__target;
        g_return_val_if_fail (IS_FOO (self), NULL);
        _tmp0_ = self->priv->_deleg_no_target;
-       _tmp0__target = self->priv->_deleg_no_target_target;
+       _tmp0__target = NULL;
        result = _tmp0_;
        return result;
 }
@@ -313,13 +305,7 @@ foo_set_deleg_no_target (Foo* self,
                          Manam value)
 {
        g_return_if_fail (IS_FOO (self));
-       (self->priv->_deleg_no_target_target_destroy_notify == NULL) ? NULL : (self->priv->_deleg_no_target_target_destroy_notify (self->priv->_deleg_no_target_target), NULL);
-       self->priv->_deleg_no_target = NULL;
-       self->priv->_deleg_no_target_target = NULL;
-       self->priv->_deleg_no_target_target_destroy_notify = NULL;
        self->priv->_deleg_no_target = value;
-       self->priv->_deleg_no_target_target = NULL;
-       self->priv->_deleg_no_target_target_destroy_notify = NULL;
 }
 
 Manam
@@ -343,7 +329,7 @@ foo_real_get_deleg_no_target_v (Foo* base)
        gpointer _tmp0__target;
        self = base;
        _tmp0_ = self->priv->_deleg_no_target_v;
-       _tmp0__target = self->priv->_deleg_no_target_v_target;
+       _tmp0__target = NULL;
        result = _tmp0_;
        return result;
 }
@@ -366,13 +352,7 @@ foo_real_set_deleg_no_target_v (Foo* base,
 {
        Foo* self;
        self = base;
-       (self->priv->_deleg_no_target_v_target_destroy_notify == NULL) ? NULL : (self->priv->_deleg_no_target_v_target_destroy_notify (self->priv->_deleg_no_target_v_target), NULL);
-       self->priv->_deleg_no_target_v = NULL;
-       self->priv->_deleg_no_target_v_target = NULL;
-       self->priv->_deleg_no_target_v_target_destroy_notify = NULL;
        self->priv->_deleg_no_target_v = value;
-       self->priv->_deleg_no_target_v_target = NULL;
-       self->priv->_deleg_no_target_v_target_destroy_notify = NULL;
 }
 
 static void
@@ -543,14 +523,6 @@ foo_finalize (Foo * obj)
        self->priv->_deleg_v = NULL;
        self->priv->_deleg_v_target = NULL;
        self->priv->_deleg_v_target_destroy_notify = NULL;
-       (self->priv->_deleg_no_target_target_destroy_notify == NULL) ? NULL : (self->priv->_deleg_no_target_target_destroy_notify (self->priv->_deleg_no_target_target), NULL);
-       self->priv->_deleg_no_target = NULL;
-       self->priv->_deleg_no_target_target = NULL;
-       self->priv->_deleg_no_target_target_destroy_notify = NULL;
-       (self->priv->_deleg_no_target_v_target_destroy_notify == NULL) ? NULL : (self->priv->_deleg_no_target_v_target_destroy_notify (self->priv->_deleg_no_target_v_target), NULL);
-       self->priv->_deleg_no_target_v = NULL;
-       self->priv->_deleg_no_target_v_target = NULL;
-       self->priv->_deleg_no_target_v_target_destroy_notify = NULL;
 }
 
 static GType
@@ -625,7 +597,7 @@ bar_get_deleg (Bar* self)
        gpointer _tmp0__target;
        g_return_val_if_fail (IS_BAR (self), NULL);
        _tmp0_ = self->priv->_deleg;
-       _tmp0__target = self->priv->_deleg_target;
+       _tmp0__target = NULL;
        result = _tmp0_;
        return result;
 }
@@ -638,13 +610,7 @@ bar_set_deleg (Bar* self,
        g_return_if_fail (IS_BAR (self));
        old_value = bar_get_deleg (self);
        if (old_value != value) {
-               (self->priv->_deleg_target_destroy_notify == NULL) ? NULL : (self->priv->_deleg_target_destroy_notify (self->priv->_deleg_target), NULL);
-               self->priv->_deleg = NULL;
-               self->priv->_deleg_target = NULL;
-               self->priv->_deleg_target_destroy_notify = NULL;
                self->priv->_deleg = value;
-               self->priv->_deleg_target = NULL;
-               self->priv->_deleg_target_destroy_notify = NULL;
                g_object_notify_by_pspec ((GObject *) self, bar_properties[BAR_DELEG_PROPERTY]);
        }
 }
@@ -670,7 +636,7 @@ bar_real_get_deleg_v (Bar* base)
        gpointer _tmp0__target;
        self = base;
        _tmp0_ = self->priv->_deleg_v;
-       _tmp0__target = self->priv->_deleg_v_target;
+       _tmp0__target = NULL;
        result = _tmp0_;
        return result;
 }
@@ -696,13 +662,7 @@ bar_real_set_deleg_v (Bar* base,
        self = base;
        old_value = bar_real_get_deleg_v (base);
        if (old_value != value) {
-               (self->priv->_deleg_v_target_destroy_notify == NULL) ? NULL : (self->priv->_deleg_v_target_destroy_notify (self->priv->_deleg_v_target), NULL);
-               self->priv->_deleg_v = NULL;
-               self->priv->_deleg_v_target = NULL;
-               self->priv->_deleg_v_target_destroy_notify = NULL;
                self->priv->_deleg_v = value;
-               self->priv->_deleg_v_target = NULL;
-               self->priv->_deleg_v_target_destroy_notify = NULL;
                g_object_notify_by_pspec ((GObject *) self, bar_properties[BAR_DELEG_V_PROPERTY]);
        }
 }
@@ -734,14 +694,6 @@ bar_finalize (GObject * obj)
 {
        Bar * self;
        self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BAR, Bar);
-       (self->priv->_deleg_target_destroy_notify == NULL) ? NULL : (self->priv->_deleg_target_destroy_notify (self->priv->_deleg_target), NULL);
-       self->priv->_deleg = NULL;
-       self->priv->_deleg_target = NULL;
-       self->priv->_deleg_target_destroy_notify = NULL;
-       (self->priv->_deleg_v_target_destroy_notify == NULL) ? NULL : (self->priv->_deleg_v_target_destroy_notify (self->priv->_deleg_v_target), NULL);
-       self->priv->_deleg_v = NULL;
-       self->priv->_deleg_v_target = NULL;
-       self->priv->_deleg_v_target_destroy_notify = NULL;
        G_OBJECT_CLASS (bar_parent_class)->finalize (obj);
 }
 
index 5756025e0fa32197011188feb6e7ecdebcb26a1a..d7e650b9168379ebd4df3cf18528674f84515dd3 100644 (file)
@@ -57,8 +57,6 @@ struct _FooClass {
 
 struct _FooPrivate {
        gchar** _bar;
-       gint _bar_length1;
-       gint __bar_size_;
 };
 
 static gint Foo_private_offset;
@@ -142,7 +140,7 @@ foo_get_bar (Foo* self)
        gint _tmp1__length1;
        g_return_val_if_fail (IS_FOO (self), NULL);
        _tmp0_ = self->priv->_bar;
-       _tmp0__length1 = self->priv->_bar_length1;
+       _tmp0__length1 = _vala_array_length (self->priv->_bar);
        _tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup1 (_tmp0_, _tmp0__length1) : _tmp0_;
        _tmp1__length1 = _tmp0__length1;
        result = _tmp1_;
@@ -179,10 +177,8 @@ foo_set_bar (Foo* self,
                gint _tmp0__length1;
                _tmp0_ = (value != NULL) ? _vala_array_dup2 (value, _vala_array_length (value)) : value;
                _tmp0__length1 = _vala_array_length (value);
-               self->priv->_bar = (_vala_array_free (self->priv->_bar, self->priv->_bar_length1, (GDestroyNotify) g_free), NULL);
+               self->priv->_bar = (_vala_array_free (self->priv->_bar, _vala_array_length (self->priv->_bar), (GDestroyNotify) g_free), NULL);
                self->priv->_bar = _tmp0_;
-               self->priv->_bar_length1 = _tmp0__length1;
-               self->priv->__bar_size_ = self->priv->_bar_length1;
                g_object_notify_by_pspec ((GObject *) self, foo_properties[FOO_BAR_PROPERTY]);
        }
        old_value = (g_free (old_value), NULL);
@@ -212,7 +208,7 @@ foo_finalize (GObject * obj)
 {
        Foo * self;
        self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_FOO, Foo);
-       self->priv->_bar = (_vala_array_free (self->priv->_bar, self->priv->_bar_length1, (GDestroyNotify) g_free), NULL);
+       self->priv->_bar = (_vala_array_free (self->priv->_bar, _vala_array_length (self->priv->_bar), (GDestroyNotify) g_free), NULL);
        G_OBJECT_CLASS (foo_parent_class)->finalize (obj);
 }
 
index a09f7e4a32611968e38a23896c08a3d54616b322..8408d60b15773e5de11870bc9ed7b3f00c21ffb7 100644 (file)
@@ -130,6 +130,11 @@ public class Vala.Property : Symbol, Lockable {
                                                        _field.set_attribute_string ("GtkChild", "name", get_attribute_string ("GtkChild", "name", name));
                                                        _field.set_attribute_bool ("GtkChild", "internal", get_attribute_bool ("GtkChild", "internal"));
                                                }
+                                               // Inherit important attributes
+                                               _field.copy_attribute_bool (this, "CCode", "array_length");
+                                               _field.copy_attribute_string (this, "CCode", "array_length_type");
+                                               _field.copy_attribute_bool (this, "CCode", "array_null_terminated");
+                                               _field.copy_attribute_bool (this, "CCode", "delegate_target");
                                        }
                                }
                                _field_checked = true;