]> 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>
Wed, 1 Apr 2020 08:17:51 +0000 (10:17 +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 dcf17a5bb1bd9225e67d2117a478931c6b1e14dc..2d6acaccb28e9465ded291a768b1ef6080908b21 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 dbe9b1f218dd7c1c9e50c0c02dda10ad0ee22907..47d9727d8d215332cda70bed0b410307fa7760b6 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.