]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add test for parameter type checking of async methods
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 18 Jan 2018 20:00:29 +0000 (21:00 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 19 Jan 2018 08:37:11 +0000 (09:37 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=792660

tests/Makefile.am
tests/asynchronous/bug792660.vala [new file with mode: 0644]

index 585bae56d1adc95b078cc214fa35b538c922b326..a27e874dca43bbbae788470b5c53aae3ed088222 100644 (file)
@@ -295,6 +295,7 @@ TESTS = \
        asynchronous/bug762819.vala \
        asynchronous/bug777242.vala \
        asynchronous/bug783543.vala \
+       asynchronous/bug792660.vala \
        asynchronous/closures.vala \
        asynchronous/generator.vala \
        asynchronous/yield.vala \
diff --git a/tests/asynchronous/bug792660.vala b/tests/asynchronous/bug792660.vala
new file mode 100644 (file)
index 0000000..b5ffddd
--- /dev/null
@@ -0,0 +1,15 @@
+abstract class Foo {
+       public abstract async void foo ([CCode (array_length = false)] string[] a, int i);
+}
+
+class Bar : Foo {
+       public override async void foo (string[] a, int i) {
+               assert (i == 42);
+       }
+}
+
+void main () {
+       string[] a = { "foo", "bar" };
+       var bar = new Bar ();
+       bar.foo.begin (a, 42);
+}