restore current_return_type after processing lambda expressions, fixes bug
authorJuerg Billeter <j@bitron.ch>
Sat, 12 Jan 2008 13:01:31 +0000 (13:01 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 12 Jan 2008 13:01:31 +0000 (13:01 +0000)
2008-01-12  Juerg Billeter  <j@bitron.ch>

* vala/valasemanticanalyzer.vala: restore current_return_type
  after processing lambda expressions, fixes bug 501586

svn path=/trunk/; revision=833

ChangeLog
vala/valasemanticanalyzer.vala

index be04f5f..6e0e608 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-01-12  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valasemanticanalyzer.vala: restore current_return_type
+         after processing lambda expressions, fixes bug 501586
+
+2008-01-12  Jürg Billeter  <j@bitron.ch>
+
        * vala/valasemanticanalyzer.vala: fix null dereference when trying to
          access members of a delegate
 
index f1037ee..97e961e 100644 (file)
@@ -349,6 +349,8 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                        }
                }
 
+               var old_symbol = current_symbol;
+               var old_return_type = current_return_type;
                current_symbol = m;
                current_return_type = m.return_type;
 
@@ -364,8 +366,8 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
 
                m.accept_children (this);
 
-               current_symbol = current_symbol.parent_symbol;
-               current_return_type = null;
+               current_symbol = old_symbol;
+               current_return_type = old_return_type;
 
                if (current_symbol.parent_symbol is Method) {
                        /* lambda expressions produce nested methods */