summaryrefslogtreecommitdiff
path: root/tests/arrays
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-07-27 13:36:56 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2020-07-27 13:46:11 +0200
commit12d8ae6fa93395b29af8c92ce9d744be2aea7fd0 (patch)
tree3f72e8979bcc0dfd4745f2eca5e6466497d15a19 /tests/arrays
parent1d220258059543cd9f4ff31027702fb4e6b8186a (diff)
downloadvala-12d8ae6fa93395b29af8c92ce9d744be2aea7fd0.tar.gz
codegen: Properly destroy elements of an inline struct array
Fixes https://gitlab.gnome.org/GNOME/vala/issues/365
Diffstat (limited to 'tests/arrays')
-rw-r--r--tests/arrays/inline-struct.vala18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/arrays/inline-struct.vala b/tests/arrays/inline-struct.vala
new file mode 100644
index 000000000..a8f05103b
--- /dev/null
+++ b/tests/arrays/inline-struct.vala
@@ -0,0 +1,18 @@
+[CCode (has_type_id = false)]
+public struct FooStruct {
+ public uint8 i;
+ public string s;
+}
+
+void main () {
+ {
+ FooStruct array[2];
+ array[0] = { 23, "foo"};
+ array[1] = { 42, "bar"};
+ }
+ {
+ GLib.Value array[2];
+ array[0].init (typeof (int));
+ array[1].init (typeof (string));
+ }
+}