diff options
| author | gingerBill <bill@gingerbill.org> | 2020-09-12 16:04:02 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-09-12 16:04:02 +0100 |
| commit | 1fd1203d8bf1977366dbf1f366623924e5c3e5c0 (patch) | |
| tree | e7fdd00bba79f675168db687f91990532c5645e2 /src/checker.cpp | |
| parent | ccb7c3513bf8f149eb46e8d698ace0d08621bf4f (diff) | |
Improve error message for multi-valued global declarations not be allowed
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index ca364d6c1..7659a42ff 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -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; } } |