[vala/staging: 2/7] vala: scope "owner" of constructor/destructor subroutines is already set



commit 30008bf3607cf98cf2221cb8532aa97a167a7542
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Nov 17 12:49:11 2019 +0100

    vala: scope "owner" of constructor/destructor subroutines is already set

 vala/valaconstructor.vala | 5 ++---
 vala/valadestructor.vala  | 3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/vala/valaconstructor.vala b/vala/valaconstructor.vala
index ae8f19e8d..4195da9ea 100644
--- a/vala/valaconstructor.vala
+++ b/vala/valaconstructor.vala
@@ -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;
        }
diff --git a/vala/valadestructor.vala b/vala/valadestructor.vala
index 7ee3843bd..33d1f1a2c 100644
--- a/vala/valadestructor.vala
+++ b/vala/valadestructor.vala
@@ -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;
        }


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