[vala/wip/transform: 69/102] Use correct SemanticAnalyzer.get_current_* methods in Transformer



commit ec631083ecf695a67f34840bf5647309e9dc3c13
Author: Luca Bruno <lucabru src gnome org>
Date:   Thu May 2 20:32:51 2013 +0200

    Use correct SemanticAnalyzer.get_current_* methods in Transformer

 codegen/valaccodetransformer.vala | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/codegen/valaccodetransformer.vala b/codegen/valaccodetransformer.vala
index 8941b7778..bd64fb030 100644
--- a/codegen/valaccodetransformer.vala
+++ b/codegen/valaccodetransformer.vala
@@ -363,7 +363,7 @@ public class Vala.CCodeTransformer : CodeTransformer {
                if (expr.tree_can_fail) {
                        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)) {
+                       } else if (!(context.analyzer.get_current_non_local_symbol (expr) is Block)) {
                                // can't handle errors in field initializers
                                Report.error (expr.source_reference, "Field initializers must not throw 
errors");
                        } else {
@@ -424,7 +424,7 @@ public class Vala.CCodeTransformer : CodeTransformer {
                var target_type = expr.target_type != null ? expr.target_type.copy () : null;
                push_builder (new CodeBuilder (context, parent_statement, expr.source_reference));
 
-               if (context.analyzer.get_current_symbol (expr) is Block
+               if (context.analyzer.get_current_non_local_symbol (expr) is Block
                    && (expr.operator == BinaryOperator.AND || expr.operator == BinaryOperator.OR)) {
                        var is_and = expr.operator == BinaryOperator.AND;
                        var result = b.add_temp_declaration (data_type ("bool"));
@@ -499,7 +499,7 @@ public class Vala.CCodeTransformer : CodeTransformer {
                if (expr.tree_can_fail) {
                        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)) {
+                       } else if (!(context.analyzer.get_current_non_local_symbol (expr) is Block)) {
                                // can't handle errors in field initializers
                                Report.error (expr.source_reference, "Field initializers must not throw 
errors");
                        } else {


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