]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: scope "owner" of constructor/destructor subroutines is already set
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 17 Nov 2019 11:49:11 +0000 (12:49 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 17 Nov 2019 11:49:11 +0000 (12:49 +0100)
vala/valaconstructor.vala
vala/valadestructor.vala

index ae8f19e8da8e9a43ce3fb384946f92973199be6e..4195da9eaad2cea8607614c80176efc3638621a7 100644 (file)
@@ -67,10 +67,9 @@ public class Vala.Constructor : Subroutine {
 
                checked = true;
 
-               this_parameter = new Parameter ("this", new ObjectType (context.analyzer.current_class));
+               this_parameter = new Parameter ("this", new ObjectType ((ObjectTypeSymbol) parent_symbol));
                scope.add (this_parameter.name, this_parameter);
 
-               owner = context.analyzer.current_symbol.scope;
                context.analyzer.current_symbol = this;
 
                if (body != null) {
@@ -85,7 +84,7 @@ public class Vala.Constructor : Subroutine {
                        }
                }
 
-               context.analyzer.current_symbol = context.analyzer.current_symbol.parent_symbol;
+               context.analyzer.current_symbol = parent_symbol;
 
                return !error;
        }
index 7ee3843bd0e80b8b7597d5dad2464d3ea944b0e3..33d1f1a2c39eb1b5fdf80eeeab5ae5ff9226ccb9 100644 (file)
@@ -67,14 +67,13 @@ public class Vala.Destructor : Subroutine {
 
                checked = true;
 
-               owner = context.analyzer.current_symbol.scope;
                context.analyzer.current_symbol = this;
 
                if (body != null) {
                        body.check (context);
                }
 
-               context.analyzer.current_symbol = context.analyzer.current_symbol.parent_symbol;
+               context.analyzer.current_symbol = parent_symbol;
 
                return !error;
        }