diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2018-02-15 18:07:36 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2018-02-15 18:09:32 +0100 |
commit | 680930f64b34daa47f6224b105aa92a4c2fff77d (patch) | |
tree | d7e57da0e43e674fc4bf7ae2c76d71d99b412eb5 /tests/basic-types | |
parent | 92e4414aad1313e12989e31b68bdf0763cf4cc6a (diff) | |
download | vala-680930f64b34daa47f6224b105aa92a4c2fff77d.tar.gz |
codegen: Don't append fixed-length of array fields in initializers
Diffstat (limited to 'tests/basic-types')
-rw-r--r-- | tests/basic-types/arrays.vala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/basic-types/arrays.vala b/tests/basic-types/arrays.vala index 4f821d94d..b749bdcb2 100644 --- a/tests/basic-types/arrays.vala +++ b/tests/basic-types/arrays.vala @@ -241,6 +241,19 @@ void test_array_resize () { assert (a[a.length - 1] == 5); } +struct Foo { + unowned string array[2]; + int bar; +} + +const Foo[] FOO_ARRAY_CONST = { + { { "foo", "bar" }, 42 }, +}; + +void test_struct_array () { + assert (FOO_ARRAY_CONST[0].bar == 42); +} + void main () { test_integer_array (); test_string_array (); @@ -256,4 +269,5 @@ void main () { test_explicit_copying (); test_array_move (); test_array_resize (); + test_struct_array (); } |