mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.2.3211: Vim9: argument types are not checked at compile time
Problem: Vim9: argument types are not checked at compile time. Solution: Add several more type checks. Fix type check for matchaddpos(). (Yegappan Lakshmanan, closes #8619)
This commit is contained in:
committed by
Bram Moolenaar
parent
dd0b287c1e
commit
7973de35ba
11
src/typval.c
11
src/typval.c
@@ -522,6 +522,17 @@ check_for_chan_or_job_arg(typval_T *args, int idx)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Give an error and return FAIL unless "args[idx]" is an optional channel or a
|
||||
* job.
|
||||
*/
|
||||
int
|
||||
check_for_opt_chan_or_job_arg(typval_T *args, int idx)
|
||||
{
|
||||
return (args[idx].v_type == VAR_UNKNOWN
|
||||
|| check_for_chan_or_job_arg(args, idx) != FAIL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Give an error and return FAIL unless "args[idx]" is a job.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user