]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GAsync: Fix non-closure lambda expressions in instance methods
authorJürg Billeter <j@bitron.ch>
Fri, 16 Oct 2009 15:59:30 +0000 (17:59 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 16 Oct 2009 15:59:56 +0000 (17:59 +0200)
Fixes bug 598697.

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

index 0dd60fa64393448a6b5cb258957c46ac64c5c801..4f656d75f64a31358fb3a668b55a3b810127c06b 100644 (file)
@@ -161,7 +161,7 @@ internal class Vala.CCodeDelegateModule : CCodeArrayModule {
                                }
                                return delegate_target;
                        } else if (get_this_type () != null || in_constructor) {
-                               CCodeExpression delegate_target = new CCodeIdentifier ("self");
+                               CCodeExpression delegate_target = get_result_cexpression ("self");
                                if (expr_owned) {
                                        if (get_this_type () != null) {
                                                var ref_call = new CCodeFunctionCall (get_dup_func_expression (get_this_type (), delegate_expr.source_reference));
index 84b888193b81228684b1dcbff9f6ce7f056b26dd..0d041e5a33714cea9fabce085badd4efada80128 100644 (file)
@@ -64,6 +64,7 @@ TESTS = \
        asynchronous/bug596177.vala \
        asynchronous/bug597294.vala \
        asynchronous/bug598677.vala \
+       asynchronous/bug598697.vala \
        asynchronous/bug598698.vala \
        dbus/basic-types.test \
        dbus/arrays.test \
diff --git a/tests/asynchronous/bug598697.vala b/tests/asynchronous/bug598697.vala
new file mode 100644 (file)
index 0000000..804039a
--- /dev/null
@@ -0,0 +1,8 @@
+public class Foo {
+       public async void do_foo () {
+               Func f = () => {};
+       }
+}
+
+void main () {
+}