body.check (analyzer);
+ var error_types = new Gee.ArrayList<DataType> ();
+ foreach (DataType body_error_type in body.get_error_types ()) {
+ error_types.add (body_error_type);
+ }
+
+ var handled_error_types = new Gee.ArrayList<DataType> ();
foreach (CatchClause clause in catch_clauses) {
+ foreach (DataType body_error_type in error_types) {
+ if (body_error_type.compatible (clause.error_type)) {
+ handled_error_types.add (body_error_type);
+ }
+ }
+ foreach (DataType handled_error_type in handled_error_types) {
+ error_types.remove (handled_error_type);
+ }
+ handled_error_types.clear ();
+
clause.check (analyzer);
+ foreach (DataType body_error_type in clause.body.get_error_types ()) {
+ error_types.add (body_error_type);
+ }
}
if (finally_body != null) {
finally_body.check (analyzer);
+ foreach (DataType body_error_type in finally_body.get_error_types ()) {
+ error_types.add (body_error_type);
+ }
}
+ add_error_types (error_types);
+
return !error;
}
}