clist.append (cexpr);
var array_type = field.variable_type as ArrayType;
- if (array_type != null && get_ccode_array_length (field) && !get_ccode_array_null_terminated (field)) {
+ if (array_type != null && !array_type.fixed_length && get_ccode_array_length (field) && !get_ccode_array_null_terminated (field)) {
for (int dim = 1; dim <= array_type.rank; dim++) {
clist.append (get_array_length_cvalue (expr.target_value, dim));
}
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 ();
test_explicit_copying ();
test_array_move ();
test_array_resize ();
+ test_struct_array ();
}