summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-08-13 23:00:44 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2020-08-14 13:19:51 +0200
commit254431cc5778421bd1bd3d0de02a55843cfa07a2 (patch)
tree2bc23298f70372b24340bb5f2dc0d9b58a709164
parent8bab9d110ab18a693e81ccbe0619cb7b5471d54f (diff)
downloadvala-wip/issue/1062.tar.gz
vala: Set parent_node for child nodes of lambda-expressionwip/issue/1062
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1062
-rw-r--r--vala/valalambdaexpression.vala23
1 files changed, 21 insertions, 2 deletions
diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala
index 6042d948b..9a6940f90 100644
--- a/vala/valalambdaexpression.vala
+++ b/vala/valalambdaexpression.vala
@@ -34,13 +34,29 @@ public class Vala.LambdaExpression : Expression {
* The expression body of this lambda expression. Only one of
* expression_body or statement_body may be set.
*/
- public Expression expression_body { get; private set; }
+ public Expression expression_body {
+ get { return _expression_body; }
+ private set {
+ _expression_body = value;
+ if (_expression_body != null) {
+ _expression_body.parent_node = this;
+ }
+ }
+ }
/**
* The statement body of this lambda expression. Only one of
* expression_body or statement_body may be set.
*/
- public Block statement_body { get; private set; }
+ public Block statement_body {
+ get { return _statement_body; }
+ private set {
+ _statement_body = value;
+ if (_statement_body != null) {
+ _statement_body.parent_node = this;
+ }
+ }
+ }
/**
* The generated method.
@@ -48,6 +64,8 @@ public class Vala.LambdaExpression : Expression {
public Method method { get; private set; }
private List<Parameter> parameters = new ArrayList<Parameter> ();
+ Block _statement_body;
+ Expression _expression_body;
/**
* Creates a new lambda expression.
@@ -168,6 +186,7 @@ public class Vala.LambdaExpression : Expression {
}
}
method.owner = context.analyzer.current_symbol.scope;
+ method.parent_node = this;
var lambda_params = get_parameters ();
Iterator<Parameter> lambda_param_it = lambda_params.iterator ();