]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Don't ignore errors in Parameter and acknowledge them further
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 5 Feb 2020 07:32:53 +0000 (08:32 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 5 Feb 2020 07:32:53 +0000 (08:32 +0100)
This avoids useless subsequent errors and possible criticals while
operating on broken AST.

vala/valacreationmethod.vala
vala/valadelegate.vala
vala/valamethod.vala
vala/valasignal.vala

index 3c0b229929348c21e92ca67c229323761c4c0c5f..89db56abe4b696a6fc836b74dfdd0307a2849650 100644 (file)
@@ -107,7 +107,9 @@ public class Vala.CreationMethod : Method {
 
                int i = 0;
                foreach (Parameter param in get_parameters()) {
-                       param.check (context);
+                       if (!param.check (context)) {
+                               error = true;
+                       }
                        if (i == 0 && param.ellipsis && body != null) {
                                error = true;
                                Report.error (param.source_reference, "Named parameter required before `...'");
index b9db0b287ba0d2037ccab30927439bd55a0ce85b..abe9f86348cafd0fac9b5e355c6f845eb4794471 100644 (file)
@@ -318,7 +318,9 @@ public class Vala.Delegate : TypeSymbol, Callable {
                }
 
                foreach (Parameter param in parameters) {
-                       param.check (context);
+                       if (!param.check (context)) {
+                               error = true;
+                       }
                }
 
                if (error_types != null) {
index f6ce67d31566bc3b82ef1819a451cf21ccb9d6a7..f5b22131ab5a56224a1330a99b1dce4f5c01c620 100644 (file)
@@ -823,7 +823,10 @@ public class Vala.Method : Subroutine, Callable {
 
                var optional_param = false;
                foreach (Parameter param in parameters) {
-                       param.check (context);
+                       if (!param.check (context)) {
+                               error = true;
+                               continue;
+                       }
                        if (coroutine && param.direction == ParameterDirection.REF) {
                                error = true;
                                Report.error (param.source_reference, "Reference parameters are not supported for async methods");
index c6390c0a39397f39dc833d2261051bd6fbccab22..f7b987994aa75c5478be9f04542fa7751926632e 100644 (file)
@@ -217,7 +217,9 @@ public class Vala.Signal : Symbol, Callable {
                                return false;
                        }
 
-                       param.check (context);
+                       if (!param.check (context)) {
+                               error = true;
+                       }
                }
 
                if (!is_virtual && body != null) {