From 37dd373f66403f8db3581c9216a5bdfdf6925a5f Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Sun, 5 Feb 2023 19:33:15 +0100 Subject: vala: Inherit more important attributes for PropertyAccessor method --- vala/valapropertyaccessor.vala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vala/valapropertyaccessor.vala b/vala/valapropertyaccessor.vala index 393284301..979239d2e 100644 --- a/vala/valapropertyaccessor.vala +++ b/vala/valapropertyaccessor.vala @@ -122,6 +122,12 @@ public class Vala.PropertyAccessor : Subroutine { Method? m = null; if (readable) { m = new Method ("get_%s".printf (prop.name), value_type, source_reference, comment); + + // Inherit important attributes + m.copy_attribute_bool (prop, "CCode", "array_length"); + m.copy_attribute_string (prop, "CCode", "array_length_type"); + m.copy_attribute_bool (prop, "CCode", "array_null_terminated"); + m.copy_attribute_bool (prop, "CCode", "delegate_target"); } else if (writable) { m = new Method ("set_%s".printf (prop.name), new VoidType(), source_reference, comment); m.add_parameter (value_parameter.copy ()); @@ -162,6 +168,7 @@ public class Vala.PropertyAccessor : Subroutine { value_parameter = new Parameter ("value", value_type, source_reference); // Inherit important attributes value_parameter.copy_attribute_bool (prop, "CCode", "array_length"); + value_parameter.copy_attribute_string (prop, "CCode", "array_length_type"); value_parameter.copy_attribute_bool (prop, "CCode", "array_null_terminated"); value_parameter.copy_attribute_bool (prop, "CCode", "delegate_target"); } -- cgit v1.2.1