diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-07-27 13:36:56 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-07-27 13:46:11 +0200 |
commit | 12d8ae6fa93395b29af8c92ce9d744be2aea7fd0 (patch) | |
tree | 3f72e8979bcc0dfd4745f2eca5e6466497d15a19 /tests | |
parent | 1d220258059543cd9f4ff31027702fb4e6b8186a (diff) | |
download | vala-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')
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/arrays/inline-struct.vala | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index b224eb437..c604b2887 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -93,6 +93,7 @@ TESTS = \ arrays/inline-local-instantiation.test \ arrays/inline-local-variable.test \ arrays/inline-parameter.test \ + arrays/inline-struct.vala \ arrays/inline-struct-field.test \ arrays/in-operator-with-boxed-needle.vala \ arrays/length-inline-assignment.vala \ 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)); + } +} |