]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Improve error handling of nested initializer lists
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 2 Jul 2020 14:50:36 +0000 (16:50 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 26 Jul 2020 08:37:25 +0000 (10:37 +0200)
This avoids reporting consequential errors.

vala/valainitializerlist.vala

index 58301b6e2178325f274dddc93a5e5949a21e26ef..54a0bdc699a201b72a630bff237c971b22576111 100644 (file)
@@ -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;