[vala/685-remove-context-from-semantic-analyzer] vala: removed CodeContext reference in SemanticAnalyzer



commit 8e67d65bb18a7c205cc023b414357022f5ec4d19
Author: Daniel Espinosa <esodan gmail com>
Date:   Tue Oct 16 17:05:24 2018 -0500

    vala: removed CodeContext reference in SemanticAnalyzer

 vala/valasemanticanalyzer.vala | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala
index c0c075f9a..f789eace6 100644
--- a/vala/valasemanticanalyzer.vala
+++ b/vala/valasemanticanalyzer.vala
@@ -28,7 +28,6 @@ using GLib;
  * Code visitor analyzing and checking code.
  */
 public class Vala.SemanticAnalyzer : CodeVisitor {
-       CodeContext context;
 
        public Symbol current_symbol { get; set; }
        public SourceFile current_source_file { get; set; }
@@ -175,7 +174,6 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
         * @param context a code context
         */
        public void analyze (CodeContext context) {
-               this.context = context;
 
                var root_symbol = context.root;
 
@@ -223,13 +221,12 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                context.root.check (context);
                context.accept (this);
 
-               this.context = null;
        }
 
        public override void visit_source_file (SourceFile file) {
                current_source_file = file;
 
-               file.check (context);
+               file.check (CodeContext.get ());
        }
 
        // check whether type is at least as accessible as the specified symbol
@@ -959,7 +956,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                init.initializer.formal_target_type = member_type;
                init.initializer.target_type = init.initializer.formal_target_type.get_actual_type (type, 
null, init);
 
-               init.check (context);
+               init.check (CodeContext.get ());
 
                if (init.initializer.value_type == null || !init.initializer.value_type.compatible 
(init.initializer.target_type)) {
                        init.error = true;


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