From: Jürg Billeter Date: Fri, 16 Oct 2009 15:59:30 +0000 (+0200) Subject: GAsync: Fix non-closure lambda expressions in instance methods X-Git-Tag: 0.7.8~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d32e981f704891e7532d15c8458c752fec86f7df;p=thirdparty%2Fvala.git GAsync: Fix non-closure lambda expressions in instance methods Fixes bug 598697. --- diff --git a/codegen/valaccodedelegatemodule.vala b/codegen/valaccodedelegatemodule.vala index 0dd60fa64..4f656d75f 100644 --- a/codegen/valaccodedelegatemodule.vala +++ b/codegen/valaccodedelegatemodule.vala @@ -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)); diff --git a/tests/Makefile.am b/tests/Makefile.am index 84b888193..0d041e5a3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 index 000000000..804039a42 --- /dev/null +++ b/tests/asynchronous/bug598697.vala @@ -0,0 +1,8 @@ +public class Foo { + public async void do_foo () { + Func f = () => {}; + } +} + +void main () { +}