summaryrefslogtreecommitdiff
path: root/vala/valafield.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-02-01 14:47:00 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2020-02-01 14:58:43 +0100
commite336a027c3ee11a1250abd455ebadd5b32a4756a (patch)
tree066ebce056a338c8f0747b3d9c1f37f7b44fc02f /vala/valafield.vala
parentebda0136b9525ce5d1b322995ab5d0e70ade79a3 (diff)
downloadvala-e336a027c3ee11a1250abd455ebadd5b32a4756a.tar.gz
vala: Inline allocated arrays require length or initializer
Fixes https://gitlab.gnome.org/GNOME/vala/issues/903
Diffstat (limited to 'vala/valafield.vala')
-rw-r--r--vala/valafield.vala5
1 files changed, 5 insertions, 0 deletions
diff --git a/vala/valafield.vala b/vala/valafield.vala
index dc4cde63e..25eec89f4 100644
--- a/vala/valafield.vala
+++ b/vala/valafield.vala
@@ -123,6 +123,11 @@ public class Vala.Field : Variable, Lockable {
initializer = null;
}
+ if (variable_array_type != null && variable_array_type.inline_allocated
+ && !variable_array_type.fixed_length) {
+ Report.error (source_reference, "Inline allocated array as field requires to have fixed length");
+ }
+
if (initializer != null) {
initializer.target_type = variable_type;