Improve error message for multi-valued global declarations not be allowed

This commit is contained in:
gingerBill
2020-09-12 16:04:02 +01:00
parent ccb7c3513b
commit 1fd1203d8b
2 changed files with 8 additions and 7 deletions
+2 -6
View File
@@ -2860,12 +2860,8 @@ bool check_arity_match(CheckerContext *c, AstValueDecl *vd, bool is_global) {
return false;
} else if (is_global) {
Ast *n = vd->values[rhs-1];
isize total = get_total_value_count(vd->values);
if (total > rhs) {
error(n, "Global declarations do not allow for multi-valued expressions. Expected %td expressions on the right hand side, got %td", lhs, rhs);
} else {
error(n, "Expected %td expressions on the right hand side, got %td", lhs, rhs);
}
error(n, "Expected %td expressions on the right hand side, got %td", lhs, rhs);
error_line("Note: Global declarations do not allow for multi-valued expressions");
return false;
}
}