[vala/0.40] vala: Don't ignore errors in Parameter and acknowledge them further
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.40] vala: Don't ignore errors in Parameter and acknowledge them further
- Date: Wed, 5 Feb 2020 10:04:21 +0000 (UTC)
commit d10070d693a80a2fb0df18ccd40083832a42a1b9
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Feb 5 08:32:53 2020 +0100
vala: Don't ignore errors in Parameter and acknowledge them further
This avoids useless subsequent errors and possible criticals while
operating on broken AST.
vala/valacreationmethod.vala | 4 +++-
vala/valadelegate.vala | 4 +++-
vala/valamethod.vala | 5 ++++-
vala/valasignal.vala | 4 +++-
4 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/vala/valacreationmethod.vala b/vala/valacreationmethod.vala
index bd2acb243..86d6b013d 100644
--- a/vala/valacreationmethod.vala
+++ b/vala/valacreationmethod.vala
@@ -101,7 +101,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
`...'");
diff --git a/vala/valadelegate.vala b/vala/valadelegate.vala
index bcfb1d27a..cd9911d1d 100644
--- a/vala/valadelegate.vala
+++ b/vala/valadelegate.vala
@@ -275,7 +275,9 @@ public class Vala.Delegate : TypeSymbol, Callable {
}
foreach (Parameter param in parameters) {
- param.check (context);
+ if (!param.check (context)) {
+ error = true;
+ }
}
foreach (DataType error_type in get_error_types ()) {
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index 6328b0272..1fdd782e4 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -740,7 +740,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");
diff --git a/vala/valasignal.vala b/vala/valasignal.vala
index db92c8592..c2fbd8c91 100644
--- a/vala/valasignal.vala
+++ b/vala/valasignal.vala
@@ -205,7 +205,9 @@ public class Vala.Signal : Symbol, Lockable, Callable {
return false;
}
- param.check (context);
+ if (!param.check (context)) {
+ error = true;
+ }
}
if (!is_virtual && body != null) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]