From 787a1e363e1f41e4c745cbc0ed4758c1c34fc2e8 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Wed, 27 Nov 2019 11:42:55 +0100 Subject: 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. --- vala/valablock.vala | 4 +++- vala/valacreationmethod.vala | 2 +- 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 (); 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 (); body.get_error_types (body_errors); foreach (DataType body_error_type in body_errors) { -- cgit v1.2.1