patch 8.2.1551: Vim9: error for argument type does not mention the number
Problem: Vim9: error for argument type does not mention the number.
Solution: Pass the argument number to where the error is given.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index bec6988..0c9f56f 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -729,7 +729,7 @@
cctx_T *cctx,
int silent)
{
- if (check_type(expected, actual, FALSE) == OK)
+ if (check_type(expected, actual, FALSE, 0) == OK)
return OK;
if (actual->tt_type != VAR_ANY
&& actual->tt_type != VAR_UNKNOWN
@@ -3581,7 +3581,7 @@
generate_ppconst(cctx, ppconst);
actual = ((type_T **)stack->ga_data)[stack->ga_len - 1];
- if (check_type(want_type, actual, FALSE) == FAIL)
+ if (check_type(want_type, actual, FALSE, 0) == FAIL)
{
if (need_type(actual, want_type, -1, cctx, FALSE) == FAIL)
return FAIL;
@@ -6500,13 +6500,9 @@
did_set_arg_type = TRUE;
ufunc->uf_arg_types[arg_idx] = val_type;
}
- else if (check_type(ufunc->uf_arg_types[arg_idx], val_type, FALSE)
- == FAIL)
- {
- arg_type_mismatch(ufunc->uf_arg_types[arg_idx], val_type,
- arg_idx + 1);
+ else if (check_type(ufunc->uf_arg_types[arg_idx], val_type,
+ TRUE, arg_idx + 1) == FAIL)
goto erret;
- }
if (generate_STORE(&cctx, ISN_STORE, i - count - off, NULL) == FAIL)
goto erret;