summaryrefslogtreecommitdiff
path: root/tests/asynchronous
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-09-27 10:38:41 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2020-09-27 10:52:55 +0200
commit07057c8cdd164223b70eafbef8b1db096df97974 (patch)
treee0899e8cfe97ac167af0e058df52eac637c860ee /tests/asynchronous
parent72a6054150ff3b160eb3664fba1b646d0f1fa572 (diff)
downloadvala-07057c8cdd164223b70eafbef8b1db096df97974.tar.gz
codegen: Don't falsly use g_return_val_if_fail() for async creation method
Asynchronous creation methods are represented by 5 functions, "*_new", "*_new_finish", "*_construct", "*_construct_co" and "*_construct_finish". The argument checks are emitted in "*_construct" which is a void function and cannot return any value. Regression of 43f3e2ca534d082433fbe62aa347b7af443f9f33 Fixes https://gitlab.gnome.org/GNOME/vala/issues/1077
Diffstat (limited to 'tests/asynchronous')
-rw-r--r--tests/asynchronous/constructor-argument-check.vala13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/asynchronous/constructor-argument-check.vala b/tests/asynchronous/constructor-argument-check.vala
new file mode 100644
index 000000000..22238108a
--- /dev/null
+++ b/tests/asynchronous/constructor-argument-check.vala
@@ -0,0 +1,13 @@
+class Foo {
+ public async Foo (string bar) {
+ assert (bar == "foo");
+ }
+}
+
+async void run () {
+ yield new Foo ("foo");
+}
+
+void main () {
+ run.begin ();
+}