summaryrefslogtreecommitdiff
path: root/vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-02-20 15:19:37 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2020-02-20 15:22:17 +0100
commit169b99003aa8050de9dd69c47dff57b43b82ec1e (patch)
treea794565a8b0fa1557a71091721b6d1470a6324d0 /vala
parentfb4ddde169b7b80b6bd1ddb73b20d420e7b39160 (diff)
downloadvala-169b99003aa8050de9dd69c47dff57b43b82ec1e.tar.gz
vala: Don't check for unhandled error if error is set on body
This is how Method and CreationMethod behave already.
Diffstat (limited to 'vala')
-rw-r--r--vala/valaconstructor.vala12
-rw-r--r--vala/valapropertyaccessor.vala2
2 files changed, 9 insertions, 5 deletions
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<DataType> ();
- 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<DataType> ();
+ 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<DataType> ();
body.get_error_types (error_types);
foreach (DataType body_error_type in error_types) {