From: Rico Tzschichholz Date: Thu, 20 Feb 2020 14:19:37 +0000 (+0100) Subject: vala: Don't check for unhandled error if error is set on body X-Git-Tag: 0.47.92~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=169b99003aa8050de9dd69c47dff57b43b82ec1e;p=thirdparty%2Fvala.git vala: Don't check for unhandled error if error is set on body This is how Method and CreationMethod behave already. --- diff --git a/vala/valaconstructor.vala b/vala/valaconstructor.vala index a4844c728..a867f3a39 100644 --- a/vala/valaconstructor.vala +++ b/vala/valaconstructor.vala @@ -77,11 +77,13 @@ public class Vala.Constructor : Subroutine { body.check (context); } - var body_errors = new ArrayList (); - body.get_error_types (body_errors); - foreach (DataType body_error_type in body_errors) { - if (!((ErrorType) body_error_type).dynamic_error) { - Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string())); + if (body != null && !body.error) { + var body_errors = new ArrayList (); + body.get_error_types (body_errors); + foreach (DataType body_error_type in body_errors) { + if (!((ErrorType) body_error_type).dynamic_error) { + Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string())); + } } } diff --git a/vala/valapropertyaccessor.vala b/vala/valapropertyaccessor.vala index bb718470f..101fc018f 100644 --- a/vala/valapropertyaccessor.vala +++ b/vala/valapropertyaccessor.vala @@ -238,7 +238,9 @@ public class Vala.PropertyAccessor : Subroutine { } body.check (context); + } + if (body != null && !body.error) { var error_types = new ArrayList (); body.get_error_types (error_types); foreach (DataType body_error_type in error_types) {