summaryrefslogtreecommitdiff
path: root/vala/valaarraycreationexpression.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-06-15 20:18:11 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2020-06-15 20:18:35 +0200
commitd906da86aead742623ce04efde3620a4f8719835 (patch)
tree76f63b1789f3f38787cebca61b9fcd1137f37992 /vala/valaarraycreationexpression.vala
parent948edc40467d158bbfd2666424beae2d8b2758c0 (diff)
downloadvala-d906da86aead742623ce04efde3620a4f8719835.tar.gz
vala: Use correct value-type for ArrayCreationExpression used as argument
Copy fixed_length and inline_allocated attributes from formal-target-type. Fixes https://gitlab.gnome.org/GNOME/vala/issues/1009
Diffstat (limited to 'vala/valaarraycreationexpression.vala')
-rw-r--r--vala/valaarraycreationexpression.vala4
1 files changed, 4 insertions, 0 deletions
diff --git a/vala/valaarraycreationexpression.vala b/vala/valaarraycreationexpression.vala
index 630375281..58a2135ad 100644
--- a/vala/valaarraycreationexpression.vala
+++ b/vala/valaarraycreationexpression.vala
@@ -325,6 +325,10 @@ public class Vala.ArrayCreationExpression : Expression {
value_type = new ArrayType (element_type, rank, source_reference);
((ArrayType) value_type).length_type = length_type.copy ();
+ if (formal_target_type is ArrayType) {
+ ((ArrayType) value_type).fixed_length = ((ArrayType) formal_target_type).fixed_length;
+ ((ArrayType) value_type).inline_allocated = ((ArrayType) formal_target_type).inline_allocated;
+ }
value_type.value_owned = true;
if (!value_type.check (context)) {