patch 8.2.3229: Vim9: runtime and compile time type checks are not the same
Problem: Vim9: runtime and compile time type checks are not the same.
Solution: Add more runtime type checks for builtin functions. (Yegappan
Lakshmanan, closes #8646)
diff --git a/src/sign.c b/src/sign.c
index 85c8d14..9aded72 100644
--- a/src/sign.c
+++ b/src/sign.c
@@ -2278,6 +2278,9 @@
if (rettv_list_alloc_id(rettv, aid_sign_getdefined) != OK)
return;
+ if (in_vim9script() && check_for_opt_string_arg(argvars, 0) == FAIL)
+ return;
+
if (argvars[0].v_type != VAR_UNKNOWN)
{
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
@@ -2573,6 +2576,9 @@
if (rettv_list_alloc(rettv) != OK)
return;
+ if (in_vim9script() && check_for_list_arg(argvars, 0) == FAIL)
+ return;
+
if (argvars[0].v_type != VAR_LIST)
{
emsg(_(e_listreq));
@@ -2620,6 +2626,10 @@
{
char_u *name;
+ if (in_vim9script()
+ && check_for_opt_string_or_list_arg(argvars, 0) == FAIL)
+ return;
+
if (argvars[0].v_type == VAR_LIST && argvars[1].v_type == VAR_UNKNOWN)
{
// Undefine multiple signs
@@ -2761,6 +2771,11 @@
rettv->vval.v_number = -1;
+ if (in_vim9script()
+ && (check_for_string_arg(argvars, 0) == FAIL
+ || check_for_opt_dict_arg(argvars, 1) == FAIL))
+ return;
+
if (argvars[0].v_type != VAR_STRING)
{
emsg(_(e_invarg));
@@ -2792,6 +2807,9 @@
if (rettv_list_alloc(rettv) != OK)
return;
+ if (in_vim9script() && check_for_list_arg(argvars, 0) == FAIL)
+ return;
+
if (argvars[0].v_type != VAR_LIST)
{
emsg(_(e_listreq));