[vala/staging: 2/2] vala: More regular invocations of check() on inferred Expression.value_type
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging: 2/2] vala: More regular invocations of check() on inferred Expression.value_type
- Date: Wed, 6 Mar 2019 16:33:06 +0000 (UTC)
commit 13f38eb6e2f21a9a02a3536323b1496bfb82cad4
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Mar 6 15:55:13 2019 +0100
vala: More regular invocations of check() on inferred Expression.value_type
vala/valaassignment.vala | 4 ++++
vala/valabinaryexpression.vala | 2 ++
vala/valaconditionalexpression.vala | 1 +
vala/valaelementaccess.vala | 2 ++
vala/valainitializerlist.vala | 4 ++++
vala/valamemberaccess.vala | 4 ++++
vala/valamethodcall.vala | 2 ++
vala/valareferencetransferexpression.vala | 1 +
vala/valasliceexpression.vala | 1 +
vala/valaunaryexpression.vala | 2 ++
10 files changed, 23 insertions(+)
---
diff --git a/vala/valaassignment.vala b/vala/valaassignment.vala
index 414edd017..0b6fbc9ad 100644
--- a/vala/valaassignment.vala
+++ b/vala/valaassignment.vala
@@ -413,6 +413,10 @@ public class Vala.Assignment : Expression {
value_type = null;
}
+ if (value_type != null) {
+ value_type.check (context);
+ }
+
return !error;
}
diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala
index 5c9cefbe4..0dd61b6c1 100644
--- a/vala/valabinaryexpression.vala
+++ b/vala/valabinaryexpression.vala
@@ -528,6 +528,8 @@ public class Vala.BinaryExpression : Expression {
assert_not_reached ();
}
+ value_type.check (context);
+
return !error;
}
diff --git a/vala/valaconditionalexpression.vala b/vala/valaconditionalexpression.vala
index ce1ee10ad..3395dd56f 100644
--- a/vala/valaconditionalexpression.vala
+++ b/vala/valaconditionalexpression.vala
@@ -200,6 +200,7 @@ public class Vala.ConditionalExpression : Expression {
value_type.value_owned = (true_expression.value_type.value_owned ||
false_expression.value_type.value_owned);
value_type.floating_reference = false;
+ value_type.check (context);
local.variable_type = value_type;
decl.check (context);
diff --git a/vala/valaelementaccess.vala b/vala/valaelementaccess.vala
index bc1072901..b847e9515 100644
--- a/vala/valaelementaccess.vala
+++ b/vala/valaelementaccess.vala
@@ -247,6 +247,8 @@ public class Vala.ElementAccess : Expression {
}
}
+ value_type.check (context);
+
return !error;
}
diff --git a/vala/valainitializerlist.vala b/vala/valainitializerlist.vala
index 6d170f4ec..f7d806cfe 100644
--- a/vala/valainitializerlist.vala
+++ b/vala/valainitializerlist.vala
@@ -247,6 +247,10 @@ public class Vala.InitializerList : Expression {
value_type.nullable = false;
}
+ if (value_type != null) {
+ value_type.check (context);
+ }
+
return !error;
}
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index 8fd60db56..dfd68a4aa 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -857,6 +857,10 @@ public class Vala.MemberAccess : Expression {
}
}
+ if (value_type != null) {
+ value_type.check (context);
+ }
+
return !error;
}
diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala
index fc1bfed11..af44a2a5b 100644
--- a/vala/valamethodcall.vala
+++ b/vala/valamethodcall.vala
@@ -630,6 +630,8 @@ public class Vala.MethodCall : Expression {
}
}
+ value_type.check (context);
+
if (tree_can_fail) {
if (parent_node is LocalVariable || parent_node is ExpressionStatement) {
// simple statements, no side effects after method call
diff --git a/vala/valareferencetransferexpression.vala b/vala/valareferencetransferexpression.vala
index 6a06b1d65..f9b428997 100644
--- a/vala/valareferencetransferexpression.vala
+++ b/vala/valareferencetransferexpression.vala
@@ -109,6 +109,7 @@ public class Vala.ReferenceTransferExpression : Expression {
value_type = inner.value_type.copy ();
value_type.value_owned = true;
+ value_type.check (context);
return !error;
}
diff --git a/vala/valasliceexpression.vala b/vala/valasliceexpression.vala
index 4d3e84489..563733031 100644
--- a/vala/valasliceexpression.vala
+++ b/vala/valasliceexpression.vala
@@ -145,6 +145,7 @@ public class Vala.SliceExpression : Expression {
if (container.value_type is ArrayType) {
value_type = container.value_type.copy ();
value_type.value_owned = false;
+ value_type.check (context);
/* check if the index is of type integer */
if (!(start.value_type is IntegerType || start.value_type is EnumValueType)) {
diff --git a/vala/valaunaryexpression.vala b/vala/valaunaryexpression.vala
index e04dcb57d..d371d39d9 100644
--- a/vala/valaunaryexpression.vala
+++ b/vala/valaunaryexpression.vala
@@ -236,6 +236,8 @@ public class Vala.UnaryExpression : Expression {
return false;
}
+ value_type.check (context);
+
return !error;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]