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/menu.c b/src/menu.c
index fb4be21..b9f7db2 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -2941,6 +2941,11 @@
return;
retdict = rettv->vval.v_dict;
+ if (in_vim9script()
+ && (check_for_string_arg(argvars, 0) == FAIL
+ || check_for_opt_string_arg(argvars, 1) == FAIL))
+ return;
+
menu_name = tv_get_string_chk(&argvars[0]);
if (menu_name == NULL)
return;