]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Set the scope of the codebuilder block for symbol resolution
authorLuca Bruno <lucabru@src.gnome.org>
Sun, 2 Feb 2014 19:39:52 +0000 (20:39 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 19 Apr 2019 13:29:54 +0000 (15:29 +0200)
vala/valacodebuilder.vala
vala/valacodetransformer.vala
vala/valasymbolresolver.vala

index bbe8a5cc887b1500a9733a5e8ee4c3666ee5b6e9..24774e71e148f7b50031972ff376c5ded243bbd5 100644 (file)
@@ -35,6 +35,7 @@ public class Vala.CodeBuilder {
                this.source_reference = source_reference;
 
                current_block = new Block (source_reference);
+               current_block.owner = context.analyzer.get_current_symbol (insert_statement).scope;
                insert_block = context.analyzer.get_current_block (insert_statement);
                insert_block.insert_before (insert_statement, current_block);
                this.insert_statement = current_block;
index cfb661f646900beb83fd896559a2bdac8faa98f8..a22842c68beac8ab5e7d624091e63a8817fbfa64 100644 (file)
@@ -194,6 +194,10 @@ public class Vala.CodeTransformer : CodeVisitor {
        }
 
        public void check (CodeNode node) {
+               var sym = context.analyzer.get_current_symbol (node);
+               if (sym != null) {
+                       context.resolver.current_scope = sym.scope;
+               }
                node.accept (context.resolver);
                if (!node.check (context)) {
                        return;
index 1c0da5bcf60056dce66ab55c1ff743d395bfa77c..cf30a491ec5327a5c2237fbd65c3d9e2f6e75386 100644 (file)
@@ -29,7 +29,7 @@ using GLib;
  */
 public class Vala.SymbolResolver : CodeVisitor {
        Symbol root_symbol;
-       Scope current_scope;
+       public Scope current_scope;
 
        /**
         * Resolve symbol names in the specified code context.