[vala] GAsync: Fix virtual async methods



commit 93c04c2de4c25c40e83c6ea9bc73a2fa474d2373
Author: Jürg Billeter <j bitron ch>
Date:   Thu Nov 5 16:09:39 2009 +0100

    GAsync: Fix virtual async methods
    
    Fixes bug 600827.

 codegen/valagtypemodule.vala      |    2 +-
 tests/Makefile.am                 |    1 +
 tests/asynchronous/bug600827.vala |    9 +++++++++
 3 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index e24ab34..0acde87 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -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"));
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4773f3a..7e6f222 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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
index 0000000..709ee72
--- /dev/null
+++ b/tests/asynchronous/bug600827.vala
@@ -0,0 +1,9 @@
+public class Foo {
+	public virtual async void do_foo () {
+	}
+}
+
+void main () {
+	var foo = new Foo ();
+	foo.do_foo ();
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]