[vala] GAsync: Fix generating finish method for generic async methods



commit dd5e668522b194ade8118dc3620457cd1b7ed9d5
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun Jul 10 13:22:44 2011 +0200

    GAsync: Fix generating finish method for generic async methods
    
    Fixes bug 654336.

 codegen/valaccodemethodmodule.vala |    2 +-
 tests/Makefile.am                  |    1 +
 tests/asynchronous/bug654336.vala  |    8 ++++++++
 3 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 607d5f6..9e4d8a9 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -826,7 +826,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
 				}
 				type_param_index++;
 			}
-		} else if (!m.closure) {
+		} else if (!m.closure && (direction & 1) == 1) {
 			int type_param_index = 0;
 			foreach (var type_param in m.get_type_parameters ()) {
 				cparam_map.set (get_param_pos (0.1 * type_param_index + 0.01), new CCodeParameter ("%s_type".printf (type_param.name.down ()), "GType"));
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9a2c4e2..75eaf17 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -125,6 +125,7 @@ TESTS = \
 	asynchronous/bug646945.vala \
 	asynchronous/bug652252.vala \
 	asynchronous/bug653861.vala \
+	asynchronous/bug654336.vala \
 	asynchronous/closures.vala \
 	dbus/basic-types.test \
 	dbus/arrays.test \
diff --git a/tests/asynchronous/bug654336.vala b/tests/asynchronous/bug654336.vala
new file mode 100644
index 0000000..cbafc85
--- /dev/null
+++ b/tests/asynchronous/bug654336.vala
@@ -0,0 +1,8 @@
+async void foo<T>() { }
+
+async void bar () {
+	yield foo<int> ();
+}
+
+void main () {
+}



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