diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2023-02-05 19:33:15 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2023-02-05 19:33:15 +0100 |
commit | 37dd373f66403f8db3581c9216a5bdfdf6925a5f (patch) | |
tree | 234a99378cddf25309d7b6b93ddad04a4d05c7c0 | |
parent | c72958545735716f752a439cda183bf5c45333d5 (diff) | |
download | vala-37dd373f66403f8db3581c9216a5bdfdf6925a5f.tar.gz |
vala: Inherit more important attributes for PropertyAccessor method
-rw-r--r-- | vala/valapropertyaccessor.vala | 7 |
1 files changed, 7 insertions, 0 deletions
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"); } |