]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
dova: Fix non-void lambda expressions
authorJürg Billeter <j@bitron.ch>
Sat, 3 Jul 2010 07:57:37 +0000 (09:57 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 3 Jul 2010 10:47:58 +0000 (12:47 +0200)
vala/valalambdaexpression.vala

index 086b36f31a21c01ec92295aa1e68985ccd176931..ec6b9a148dff02202e1af31643cbb1a73f759e3a 100644 (file)
@@ -162,6 +162,11 @@ public class Vala.LambdaExpression : Expression {
                }
                method.owner = analyzer.current_symbol.scope;
 
+               if (!(method.return_type is VoidType) && CodeContext.get ().profile == Profile.DOVA) {
+                       method.result_var = new LocalVariable (method.return_type.copy (), "result", null, source_reference);
+                       method.result_var.is_result = true;
+               }
+
                var lambda_params = get_parameters ();
                Iterator<string> lambda_param_it = lambda_params.iterator ();