[vala] GAsync: Fix abstract interface implementations



commit e4a3bc64f91a4142389a86c71916ea5a4ae924c7
Author: Jürg Billeter <j bitron ch>
Date:   Fri Oct 16 17:56:19 2009 +0200

    GAsync: Fix abstract interface implementations
    
    Fixes bug 598698.

 codegen/valagtypemodule.vala      |    7 ++++++-
 tests/Makefile.am                 |    1 +
 tests/asynchronous/bug598698.vala |   10 ++++++++++
 3 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 6f33756..cd8135e 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -1278,7 +1278,12 @@ internal class Vala.GTypeModule : GErrorModule {
 			init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ciface, m.base_interface_method.vfunc_name), cfunc)));
 
 			if (m.coroutine) {
-				init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ciface, m.base_interface_method.get_finish_vfunc_name ()), new CCodeIdentifier (m.get_finish_real_cname ()))));
+				if (m.is_abstract || m.is_virtual) {
+					cfunc = new CCodeIdentifier (m.get_finish_cname ());
+				} else {
+					cfunc = new CCodeIdentifier (m.get_finish_real_cname ());
+				}
+				init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ciface, m.base_interface_method.get_finish_vfunc_name ()), cfunc)));
 			}
 		}
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bb6ac8b..84b8881 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -64,6 +64,7 @@ TESTS = \
 	asynchronous/bug596177.vala \
 	asynchronous/bug597294.vala \
 	asynchronous/bug598677.vala \
+	asynchronous/bug598698.vala \
 	dbus/basic-types.test \
 	dbus/arrays.test \
 	dbus/async.test \
diff --git a/tests/asynchronous/bug598698.vala b/tests/asynchronous/bug598698.vala
new file mode 100644
index 0000000..5b57d46
--- /dev/null
+++ b/tests/asynchronous/bug598698.vala
@@ -0,0 +1,10 @@
+public interface Foo {
+	public abstract async void do_foo ();
+}
+
+public abstract class Bar : Foo {
+	public abstract async void do_foo ();
+}
+
+void main () {
+}



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