]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GAsync: Fix virtual async methods
authorJürg Billeter <j@bitron.ch>
Thu, 5 Nov 2009 15:09:39 +0000 (16:09 +0100)
committerJürg Billeter <j@bitron.ch>
Thu, 5 Nov 2009 15:10:21 +0000 (16:10 +0100)
Fixes bug 600827.

codegen/valagtypemodule.vala
tests/Makefile.am
tests/asynchronous/bug600827.vala [new file with mode: 0644]

index e24ab34ff43b718990f3ad034c86b1c7d449a957..0acde87f382043219e00bb21da02d7709587111e 100644 (file)
@@ -1147,7 +1147,7 @@ internal class Vala.GTypeModule : GErrorModule {
                        var base_type = m.base_method.parent_symbol;
 
                        // there is currently no default handler for abstract async methods
-                       if (m.overrides || !m.coroutine) {
+                       if (!m.is_abstract || !m.coroutine) {
                                var ccast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (((Class) base_type).get_upper_case_cname (null))));
                                ccast.add_argument (new CCodeIdentifier ("klass"));
 
index 4773f3a1805118a6853699b5b764675253e46128..7e6f222897d8c6946d596f0648e470487625cf34 100644 (file)
@@ -70,6 +70,7 @@ TESTS = \
        asynchronous/bug598697.vala \
        asynchronous/bug598698.vala \
        asynchronous/bug599568.vala \
+       asynchronous/bug600827.vala \
        dbus/basic-types.test \
        dbus/arrays.test \
        dbus/async.test \
diff --git a/tests/asynchronous/bug600827.vala b/tests/asynchronous/bug600827.vala
new file mode 100644 (file)
index 0000000..709ee72
--- /dev/null
@@ -0,0 +1,9 @@
+public class Foo {
+       public virtual async void do_foo () {
+       }
+}
+
+void main () {
+       var foo = new Foo ();
+       foo.do_foo ();
+}