patch 8.2.3173: Vim9: argument types are not checked at compile time
Problem: Vim9: argument types are not checked at compile time.
Solution: Add more type checks. (Yegappan Lakshmanan, closes #8581)
diff --git a/src/job.c b/src/job.c
index 189c06e..1271c77 100644
--- a/src/job.c
+++ b/src/job.c
@@ -1725,6 +1725,13 @@
buf_T *buf;
char_u *text;
+ if (in_vim9script()
+ && ((argvars[0].v_type != VAR_STRING
+ && argvars[0].v_type != VAR_NUMBER
+ && check_for_string_arg(argvars, 0) == FAIL)
+ || check_for_string_arg(argvars, 1) == FAIL))
+ return;
+
if (check_secure())
return;
buf = tv_get_buf(&argvars[0], FALSE);