[vala/684-remove-field-context-from-symbolresolver] vala: removed Context from SymbolResolver



commit b1e8ed3996def4c7b3bffc9d562b8650bd9c268f
Author: Daniel Espinosa <esodan gmail com>
Date:   Mon Oct 15 18:13:10 2018 -0500

    vala: removed Context from SymbolResolver
    
    Experimental non-null feature for LocalVariable was disable,
    it has no test so no-test is affected.
    
    In order con re-enable this accept for LocalVariable is necesary
    to add a parameter at CodeVisitor.visit_local_variable() to pass
    a Context

 vala/valasymbolresolver.vala | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)
---
diff --git a/vala/valasymbolresolver.vala b/vala/valasymbolresolver.vala
index 55fa94f62..ae57de834 100644
--- a/vala/valasymbolresolver.vala
+++ b/vala/valasymbolresolver.vala
@@ -28,7 +28,6 @@ using GLib;
  * Code visitor resolving symbol names.
  */
 public class Vala.SymbolResolver : CodeVisitor {
-       CodeContext context;
        Symbol root_symbol;
        Scope current_scope;
 
@@ -38,13 +37,8 @@ public class Vala.SymbolResolver : CodeVisitor {
         * @param context a code context
         */
        public void resolve (CodeContext context) {
-               this.context = context;
                root_symbol = context.root;
-
                context.root.accept (this);
-
-               root_symbol = null;
-               this.context = null;
        }
 
        public override void visit_namespace (Namespace ns) {
@@ -385,18 +379,18 @@ public class Vala.SymbolResolver : CodeVisitor {
 
        public override void visit_local_variable (LocalVariable local) {
                local.accept_children (this);
-               if (!context.experimental_non_null) {
+               // if (!context.experimental_non_null) {
                        // local reference variables are considered nullable
                        // except when using experimental non-null enhancements
-                       if (local.variable_type is ReferenceType) {
-                               var array_type = local.variable_type as ArrayType;
-                               if (array_type != null && array_type.fixed_length) {
+               //      if (local.variable_type is ReferenceType) {
+               //              var array_type = local.variable_type as ArrayType;
+               //              if (array_type != null && array_type.fixed_length) {
                                        // local fixed length arrays are not nullable
-                               } else {
-                                       local.variable_type.nullable = true;
-                               }
-                       }
-               }
+               //              } else {
+               //                      local.variable_type.nullable = true;
+               //              }
+               //      }
+               // }
        }
 
        public override void visit_initializer_list (InitializerList list) {


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