This avoids useless subsequent errors and possible criticals while
operating on broken AST.
int i = 0;
foreach (Parameter param in get_parameters()) {
- param.check (context);
+ if (!param.check (context)) {
+ error = true;
+ }
if (i == 0 && param.ellipsis && body != null) {
error = true;
Report.error (param.source_reference, "Named parameter required before `...'");
}
foreach (Parameter param in parameters) {
- param.check (context);
+ if (!param.check (context)) {
+ error = true;
+ }
}
if (error_types != null) {
var optional_param = false;
foreach (Parameter param in parameters) {
- param.check (context);
+ if (!param.check (context)) {
+ error = true;
+ continue;
+ }
if (coroutine && param.direction == ParameterDirection.REF) {
error = true;
Report.error (param.source_reference, "Reference parameters are not supported for async methods");
return false;
}
- param.check (context);
+ if (!param.check (context)) {
+ error = true;
+ }
}
if (!is_virtual && body != null) {