summaryrefslogtreecommitdiff
path: root/tests/structs
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2021-01-27 21:08:09 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2021-01-27 21:08:09 +0100
commit2e798fc3f8e9af25a4c231c2561894d9f0a0be50 (patch)
tree70ff6ed01a61b530ce5d0a3c4def9cfb50d1dbe9 /tests/structs
parent55756eab202130792651738a39d409ce9a699aa5 (diff)
downloadvala-2e798fc3f8e9af25a4c231c2561894d9f0a0be50.tar.gz
codegen: Improve support of SimpleType struct constructors
Additionally stop generating broken and superfluous dup/free functions, and don't create not used GType declarations.
Diffstat (limited to 'tests/structs')
-rw-r--r--tests/structs/simple-type-constructor.vala16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/structs/simple-type-constructor.vala b/tests/structs/simple-type-constructor.vala
new file mode 100644
index 000000000..a3a428321
--- /dev/null
+++ b/tests/structs/simple-type-constructor.vala
@@ -0,0 +1,16 @@
+[SimpleType]
+struct Foo {
+ public int i;
+ public uint j;
+
+ public Foo () {
+ i = 42;
+ j = 4711U;
+ }
+}
+
+void main () {
+ var foo = Foo ();
+ assert (foo.i == 42);
+ assert (foo.j == 4711U);
+}