[vala/staging] vala: Improve error handling of nested initializer lists
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] vala: Improve error handling of nested initializer lists
- Date: Thu, 2 Jul 2020 14:59:21 +0000 (UTC)
commit 605e50e1a678ce239e6a7c02eec1356bbe94de3b
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Jul 2 16:50:36 2020 +0200
vala: Improve error handling of nested initializer lists
This avoids reporting consequential errors.
vala/valainitializerlist.vala | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/vala/valainitializerlist.vala b/vala/valainitializerlist.vala
index 93411e470..ea6fc44e2 100644
--- a/vala/valainitializerlist.vala
+++ b/vala/valainitializerlist.vala
@@ -255,10 +255,15 @@ public class Vala.InitializerList : Expression {
}
foreach (Expression expr in initializers) {
- expr.check (context);
+ if (!expr.check (context)) {
+ error = true;
+ }
+ }
+
+ if (error) {
+ return false;
}
- bool error = false;
foreach (Expression e in get_initializers ()) {
if (e.value_type == null) {
error = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]