]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: removed CodeContext reference in SemanticAnalyzer
authorDaniel Espinosa <esodan@gmail.com>
Tue, 16 Oct 2018 22:05:24 +0000 (17:05 -0500)
committerDaniel Espinosa <esodan@gmail.com>
Thu, 10 Oct 2019 19:45:11 +0000 (14:45 -0500)
vala/valasemanticanalyzer.vala

index bb4f9b744d4f99d00b88187ee0b85057c493ee48..7e20bc6f98b31ce966bd67b635ce903de6a55f9b 100644 (file)
@@ -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; }
@@ -185,7 +184,6 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
         * @param context a code context
         */
        public void analyze (CodeContext context) {
-               this.context = context;
 
                var root_symbol = context.root;
 
@@ -249,13 +247,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
@@ -1069,7 +1066,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;