diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-02-01 14:47:00 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-02-01 14:58:43 +0100 |
commit | e336a027c3ee11a1250abd455ebadd5b32a4756a (patch) | |
tree | 066ebce056a338c8f0747b3d9c1f37f7b44fc02f /vala/valaparameter.vala | |
parent | ebda0136b9525ce5d1b322995ab5d0e70ade79a3 (diff) | |
download | vala-e336a027c3ee11a1250abd455ebadd5b32a4756a.tar.gz |
vala: Inline allocated arrays require length or initializer
Fixes https://gitlab.gnome.org/GNOME/vala/issues/903
Diffstat (limited to 'vala/valaparameter.vala')
-rw-r--r-- | vala/valaparameter.vala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala index 978fec737..9c698458b 100644 --- a/vala/valaparameter.vala +++ b/vala/valaparameter.vala @@ -167,6 +167,12 @@ public class Vala.Parameter : Variable { initializer.target_type = variable_type.copy (); initializer.check (context); } + + unowned ArrayType? variable_array_type = variable_type as ArrayType; + if (variable_array_type != null && variable_array_type.inline_allocated + && !variable_array_type.fixed_length) { + Report.error (source_reference, "Inline allocated array as parameter requires to have fixed length"); + } } if (initializer != null) { |