diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-08-30 23:24:20 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-08-30 23:24:20 +0200 |
commit | 8b565c2c1522e0c41e3d18e1bb6e1bc4b3686842 (patch) | |
tree | a9868e4023d16c89444de0df1f5a7ade212a7546 /src/vim9compile.c | |
parent | 02aaad91094939758e053588dd23ebda467eea29 (diff) | |
download | vim-git-8b565c2c1522e0c41e3d18e1bb6e1bc4b3686842.tar.gz |
patch 8.2.1551: Vim9: error for argument type does not mention the numberv8.2.1551
Problem: Vim9: error for argument type does not mention the number.
Solution: Pass the argument number to where the error is given.
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r-- | src/vim9compile.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c index bec6988e5..0c9f56f5a 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -729,7 +729,7 @@ need_type( 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 @@ compile_expr7t(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) 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 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx) 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; |