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)
diff --git a/src/if_cscope.c b/src/if_cscope.c
index 815db55..4e313ce 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -2496,6 +2496,14 @@
char_u *prepend = NULL;
char_u buf[NUMBUFLEN];
+ if (in_vim9script()
+ && (check_for_opt_number_arg(argvars, 0) == FAIL
+ || (argvars[0].v_type != VAR_UNKNOWN
+ && (check_for_opt_string_arg(argvars, 1) == FAIL
+ || (argvars[1].v_type != VAR_UNKNOWN
+ && check_for_opt_string_arg(argvars, 2) == FAIL)))))
+ return;
+
if (argvars[0].v_type != VAR_UNKNOWN
&& argvars[1].v_type != VAR_UNKNOWN)
{