mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 06:02:22 +00:00
More verbose error for invalid parameter types
This commit is contained in:
parent
0787038934
commit
be52ca3879
1 changed files with 6 additions and 2 deletions
8
ast.c
8
ast.c
|
@ -783,8 +783,12 @@ bool ast_call_check_types(ast_call *self)
|
|||
|
||||
for (i = 0; i < count; ++i) {
|
||||
if (!ast_compare_type(self->params[i], (ast_expression*)(func->expression.params[i]))) {
|
||||
asterror(ast_ctx(self), "invalid type for parameter %u in function call",
|
||||
(unsigned int)(i+1));
|
||||
char texp[1024];
|
||||
char tgot[1024];
|
||||
ast_type_to_string(self->params[i], tgot, sizeof(tgot));
|
||||
ast_type_to_string((ast_expression*)func->expression.params[i], texp, sizeof(texp));
|
||||
asterror(ast_ctx(self), "invalid type for parameter %u in function call: expected %s, got %s",
|
||||
(unsigned int)(i+1), texp, tgot);
|
||||
/* we don't immediately return */
|
||||
retval = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue