This avoids useless subsequent errors and possible criticals while
operating on broken AST.
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 ()) {
}
// 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) {
}
// 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) {