summaryrefslogtreecommitdiff
path: root/vala/valasemanticanalyzer.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-10-02 09:29:06 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2019-10-02 12:19:30 +0200
commitf3248c8531e1500db79f73fb01c426f7c3dfeeff (patch)
tree8fadf7a1f21ffc4e4415e0bf3d09439eb81f951c /vala/valasemanticanalyzer.vala
parentb2b162d368f83afb792bf8090b2bea95c58f7ea4 (diff)
downloadvala-f3248c8531e1500db79f73fb01c426f7c3dfeeff.tar.gz
codegen: Support gobject property of null-terminated array without length
Properly evaluate given array_length and array_null_terminated attributes on properties to create the expected API. Fixes https://gitlab.gnome.org/GNOME/vala/issues/855
Diffstat (limited to 'vala/valasemanticanalyzer.vala')
-rw-r--r--vala/valasemanticanalyzer.vala7
1 files changed, 6 insertions, 1 deletions
diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala
index 30c4dadf3..f9eae2b07 100644
--- a/vala/valasemanticanalyzer.vala
+++ b/vala/valasemanticanalyzer.vala
@@ -432,7 +432,12 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
}
if (!is_gobject_property_type (prop.property_type)) {
- return false;
+ if (prop.property_type is ArrayType && (!prop.get_attribute_bool ("CCode", "array_length", true)
+ && prop.get_attribute_bool ("CCode", "array_null_terminated", false))) {
+ // null-terminated arrays without length are allowed
+ } else {
+ return false;
+ }
}
if (type_sym is Class && prop.base_interface_property != null &&