]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GAsync: Fix generating finish method for generic async methods
authorLuca Bruno <lucabru@src.gnome.org>
Sun, 10 Jul 2011 11:22:44 +0000 (13:22 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Sun, 10 Jul 2011 11:43:55 +0000 (13:43 +0200)
Fixes bug 654336.

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

index 607d5f622791de628d0d2fd540c16a6518b29742..9e4d8a9e62c37176a6ec74ede2100c5456204e5f 100644 (file)
@@ -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"));
index 9a2c4e25194f7c8774ea0e125657549d27d355ac..75eaf17dca02e94154df281b8ec472b8c29e81e6 100644 (file)
@@ -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 (file)
index 0000000..cbafc85
--- /dev/null
@@ -0,0 +1,8 @@
+async void foo<T>() { }
+
+async void bar () {
+       yield foo<int> ();
+}
+
+void main () {
+}