support using lambda expressions with instance delegates
authorJuerg Billeter <j@bitron.ch>
Sun, 20 Apr 2008 11:06:11 +0000 (11:06 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sun, 20 Apr 2008 11:06:11 +0000 (11:06 +0000)
2008-04-20  Juerg Billeter  <j@bitron.ch>

* gobject/valaccodegenerator.vala: support using lambda expressions
  with instance delegates

svn path=/trunk/; revision=1284

ChangeLog
gobject/valaccodegenerator.vala

index f26f4b1..6792e36 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-04-20  Jürg Billeter  <j@bitron.ch>
 
+       * gobject/valaccodegenerator.vala: support using lambda expressions
+         with instance delegates
+
+2008-04-20  Jürg Billeter  <j@bitron.ch>
+
        * vapi/packages/gtk+-2.0/: fix gtk_*_store_set_column_types
          bindings, patch by Daniel Svensson
 
index 47822db..21cf4c4 100644 (file)
@@ -3227,6 +3227,10 @@ public class Vala.CCodeGenerator : CodeGenerator {
        }
 
        public override void visit_lambda_expression (LambdaExpression l) {
+               // use instance position from delegate
+               var dt = (DelegateType) l.expected_type;
+               l.method.cinstance_parameter_position = dt.delegate_symbol.cinstance_parameter_position;
+
                var old_temp_vars = temp_vars;
                var old_temp_ref_vars = temp_ref_vars;
                temp_vars = new ArrayList<LocalVariable> ();