patch 8.2.3206: 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. (Yegappan Lakshmanan, closes #8611)
diff --git a/src/popupwin.c b/src/popupwin.c
index 7478527..f433b87 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -2597,9 +2597,16 @@
void
f_popup_settext(typval_T *argvars, typval_T *rettv UNUSED)
{
- int id = (int)tv_get_number(&argvars[0]);
- win_T *wp = find_popup_win(id);
+ int id;
+ win_T *wp;
+ if (in_vim9script()
+ && (check_for_number_arg(argvars, 0) == FAIL
+ || check_for_string_or_list_arg(argvars, 1) == FAIL))
+ return;
+
+ id = (int)tv_get_number(&argvars[0]);
+ wp = find_popup_win(id);
if (wp != NULL)
{
if (argvars[1].v_type != VAR_STRING && argvars[1].v_type != VAR_LIST)