[vala/wip/transform: 263/264] Fix build after rebase



commit 23cdf4b5e1a5d11d8252813b4ff875e4fe166ae6
Author: Rico Tzschichholz <ricotz t-online de>
Date:   Mon Oct 1 17:03:35 2012 +0200

    Fix build after rebase

 codegen/valaccodebasemodule.vala       |    6 +++---
 codegen/valaccodetransformer.vala      |    6 ++----
 vala/valamemberaccess.vala             |    2 +-
 vala/valaobjectcreationexpression.vala |    5 +++--
 4 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 8cf1e19..195a83d 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -1943,7 +1943,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 				}
 			} else if (b.parent_symbol is ForeachStatement) {
 				var stmt = (ForeachStatement) b.parent_symbol;
-				if (!stmt.use_iterator && stmt.element_variable.captured) {
+				if (stmt.element_variable.captured) {
 					ccode.add_assignment (new CCodeMemberAccess.pointer (get_variable_cexpression ("_data%d_".printf (block_id)), get_local_cname (stmt.element_variable)), get_variable_cexpression (get_local_cname (stmt.element_variable)));
 				}
 			}
@@ -2236,7 +2236,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 		var block = local.parent_symbol;
 		if (block != null) {
 			var stmt = block.parent_symbol as ForeachStatement;
-			if (stmt != null && !stmt.use_iterator && stmt.element_variable == local) {
+			if (stmt != null && stmt.element_variable == local) {
 				return true;
 			}
 		}
@@ -5380,7 +5380,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 		                      && get_ccode_type_id (type) != "G_TYPE_VALUE");
 
 		if (type.value_owned
-		    && (target_type == null || !target_type.value_owned || boxing || unboxing || gvariant_boxing)
+		    && (target_type == null || !target_type.value_owned || boxing || unboxing)
 		    && !gvalue_boxing /* gvalue can assume ownership of value, no need to free it */) {
 			// value leaked, destroy it
 			if (target_type is PointerType) {
diff --git a/codegen/valaccodetransformer.vala b/codegen/valaccodetransformer.vala
index fed7072..947727a 100644
--- a/codegen/valaccodetransformer.vala
+++ b/codegen/valaccodetransformer.vala
@@ -508,10 +508,8 @@ public class Vala.CCodeTransformer : CodeTransformer {
 			if (expr.parent_node is LocalVariable || expr.parent_node is ExpressionStatement) {
 				// simple statements, no side effects after method call
 			} else if (!(context.analyzer.get_current_symbol (expr) is Block)) {
-				if (context.profile != Profile.DOVA) {
-					// can't handle errors in field initializers
-					Report.error (expr.source_reference, "Field initializers must not throw errors");
-				}
+				// can't handle errors in field initializers
+				Report.error (expr.source_reference, "Field initializers must not throw errors");
 			} else {
 				var old_parent_node = expr.parent_node;
 				var target_type = expr.target_type != null ? expr.target_type.copy () : null;
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index 3f4ac9c..704115e 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -551,7 +551,7 @@ public class Vala.MemberAccess : Expression {
 			access = c.access;
 
 			var block = c.parent_symbol as Block;
-			if (block != null && context.analyzer.find_parent_method_or_property_accessor (block) != context.analyzer.current_method_or_property_accessor) {
+			if (block != null && context.analyzer.get_current_method_or_property_accessor (block) != current_method_or_property_accessor) {
 				error = true;
 				Report.error (source_reference, "internal error: accessing local constants of outer methods is not supported yet");
 				return false;
diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala
index 73fdaf9..94549b0 100644
--- a/vala/valaobjectcreationexpression.vala
+++ b/vala/valaobjectcreationexpression.vala
@@ -337,11 +337,12 @@ public class Vala.ObjectCreationExpression : Expression {
 					error = true;
 					Report.error (source_reference, "yield expression requires async method");
 				}
-				if (context.analyzer.current_method == null || !context.analyzer.current_method.coroutine) {
+				var current_method = context.analyzer.get_current_method (this);
+				if (current_method == null || !current_method.coroutine) {
 					error = true;
 					Report.error (source_reference, "yield expression not available outside async method");
 				}
-				context.analyzer.current_method.yield_count++;
+				current_method.yield_count++;
 			}
 
 			var args = get_argument_list ();



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