[vala] Fix nested context information



commit 1489d90ca5f6373978dae073bd781b48258a5622
Author: Jürg Billeter <j bitron ch>
Date:   Mon Apr 6 18:02:39 2009 +0200

    Fix nested context information
---
 gobject/valaccodebasemodule.vala |    8 +++++++-
 gobject/valagobjectmodule.vala   |    3 +++
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/gobject/valaccodebasemodule.vala b/gobject/valaccodebasemodule.vala
index 9354205..20a8f02 100644
--- a/gobject/valaccodebasemodule.vala
+++ b/gobject/valaccodebasemodule.vala
@@ -1140,6 +1140,8 @@ internal class Vala.CCodeBaseModule : CCodeModule {
 	}
 
 	public override void visit_property_accessor (PropertyAccessor acc) {
+		var old_property_accessor = current_property_accessor;
+		bool old_method_inner_error = current_method_inner_error;
 		current_property_accessor = acc;
 		current_method_inner_error = false;
 
@@ -1325,11 +1327,13 @@ internal class Vala.CCodeBaseModule : CCodeModule {
 			source_type_member_definition.append (function);
 		}
 
-		current_property_accessor = null;
+		current_property_accessor = old_property_accessor;
 		current_return_type = old_return_type;
+		current_method_inner_error = old_method_inner_error;
 	}
 
 	public override void visit_destructor (Destructor d) {
+		bool old_method_inner_error = current_method_inner_error;
 		current_method_inner_error = false;
 
 		d.accept_children (codegen);
@@ -1351,6 +1355,8 @@ internal class Vala.CCodeBaseModule : CCodeModule {
 		cfrag.append (d.body.ccodenode);
 
 		d.ccodenode = cfrag;
+
+		current_method_inner_error = old_method_inner_error;
 	}
 
 	public override void visit_block (Block b) {
diff --git a/gobject/valagobjectmodule.vala b/gobject/valagobjectmodule.vala
index 3a1cf4a..38511ca 100644
--- a/gobject/valagobjectmodule.vala
+++ b/gobject/valagobjectmodule.vala
@@ -1942,6 +1942,7 @@ internal class Vala.GObjectModule : GTypeModule {
 	}
 
 	public override void visit_constructor (Constructor c) {
+		bool old_method_inner_error = current_method_inner_error;
 		current_method_inner_error = false;
 		in_constructor = true;
 
@@ -2074,6 +2075,8 @@ internal class Vala.GObjectModule : GTypeModule {
 		} else {
 			Report.error (c.source_reference, "internal error: constructors must have instance, class, or static binding");
 		}
+
+		current_method_inner_error = old_method_inner_error;
 	}
 
 	public override string get_dynamic_property_getter_cname (DynamicProperty prop) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]