[vala/wip/issue/327: 26/26] Make WithStatement a Block



commit eaf69541369bf1fec2851cbd3ca68d23c18b4a6e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Mar 28 12:38:39 2020 +0100

    Make WithStatement a Block

 vala/valasemanticanalyzer.vala | 2 +-
 vala/valawithstatement.vala    | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala
index cbb806ea4..f2d2bdd1f 100644
--- a/vala/valasemanticanalyzer.vala
+++ b/vala/valasemanticanalyzer.vala
@@ -93,7 +93,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
        public Symbol? current_method_or_property_accessor {
                get {
                        unowned Symbol? sym = current_symbol;
-                       while (sym is Block || sym is WithStatement) {
+                       while (sym is Block) {
                                sym = sym.parent_symbol;
                        }
                        if (sym is Method) {
diff --git a/vala/valawithstatement.vala b/vala/valawithstatement.vala
index 0a012ab47..50fc65e0d 100644
--- a/vala/valawithstatement.vala
+++ b/vala/valawithstatement.vala
@@ -22,7 +22,7 @@
 
 using GLib;
 
-public class Vala.WithStatement : Symbol, Statement {
+public class Vala.WithStatement : Block {
        /**
         * Expression representing the type of body's dominant scope.
         */
@@ -51,10 +51,9 @@ public class Vala.WithStatement : Symbol, Statement {
        private Block _body;
 
        public WithStatement (Expression expression, Block body, SourceReference? source_reference = null) {
-               base (null, source_reference);
+               base (source_reference);
                this.expression = expression;
                this.body = body;
-               this.source_reference = source_reference;
        }
 
        public override void accept (CodeVisitor visitor) {


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