diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-11-27 11:42:55 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-11-27 13:30:25 +0100 |
commit | 787a1e363e1f41e4c745cbc0ed4758c1c34fc2e8 (patch) | |
tree | 0be3b82820634ffb4b84cddd603fa98d39781bed | |
parent | 34409b10f9ed1dd9cbdc110f8297a8efc34613f3 (diff) | |
download | vala-787a1e363e1f41e4c745cbc0ed4758c1c34fc2e8.tar.gz |
vala: Don't ignore inner errors in Block and acknowledge them further
This avoids useless subsequent errors and possible criticals while
operating on broken AST.
-rw-r--r-- | vala/valablock.vala | 4 | ||||
-rw-r--r-- | vala/valacreationmethod.vala | 2 | ||||
-rw-r--r-- | vala/valamethod.vala | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/vala/valablock.vala b/vala/valablock.vala index c4e8ab74e..a702ea011 100644 --- a/vala/valablock.vala +++ b/vala/valablock.vala @@ -159,7 +159,9 @@ public class Vala.Block : Symbol, Statement { context.analyzer.insert_block = this; for (int i = 0; i < statement_list.size; i++) { - statement_list[i].check (context); + if (!statement_list[i].check (context)) { + error = true; + } } foreach (LocalVariable local in get_local_variables ()) { diff --git a/vala/valacreationmethod.vala b/vala/valacreationmethod.vala index 5969fd398..3c0b22992 100644 --- a/vala/valacreationmethod.vala +++ b/vala/valacreationmethod.vala @@ -179,7 +179,7 @@ public class Vala.CreationMethod : Method { } // check that all errors that can be thrown in the method body are declared - if (body != null) { + if (body != null && !body.error) { var body_errors = new ArrayList<DataType> (); body.get_error_types (body_errors); foreach (DataType body_error_type in body_errors) { diff --git a/vala/valamethod.vala b/vala/valamethod.vala index a105a0d0f..1be97ab21 100644 --- a/vala/valamethod.vala +++ b/vala/valamethod.vala @@ -954,7 +954,7 @@ public class Vala.Method : Subroutine, Callable { } // check that all errors that can be thrown in the method body are declared - if (body != null) { + if (body != null && !body.error) { var body_errors = new ArrayList<DataType> (); body.get_error_types (body_errors); foreach (DataType body_error_type in body_errors) { |