[vala/0.46] 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.46] vala: Don't ignore errors in Parameter and acknowledge them further
- Date: Wed, 5 Feb 2020 10:05:27 +0000 (UTC)
commit 47cded1288bdfee0eea372892bfc825b89a0420f
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 86e089457..a3344818f 100644
--- a/vala/valacreationmethod.vala
+++ b/vala/valacreationmethod.vala
@@ -103,7 +103,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 125011e12..ae9a56345 100644
--- a/vala/valadelegate.vala
+++ b/vala/valadelegate.vala
@@ -312,7 +312,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) {
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index ee0e5d37f..5dd00fec3 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -814,7 +814,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 de2c9a07c..de0bd1f04 100644
--- a/vala/valasignal.vala
+++ b/vala/valasignal.vala
@@ -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) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]