patch 8.2.3188: 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, also at runtime. (Yegappan
Lakshmanan, closes #8587)
diff --git a/src/dict.c b/src/dict.c
index f0f045b..8bcf28c 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -1340,6 +1340,11 @@
char_u *key;
dictitem_T *di;
+ if (in_vim9script()
+ && (check_for_dict_arg(argvars, 0) == FAIL
+ || check_for_string_or_number_arg(argvars, 1) == FAIL))
+ return;
+
if (argvars[2].v_type != VAR_UNKNOWN)
semsg(_(e_toomanyarg), "remove()");
else if ((d = argvars[0].vval.v_dict) != NULL