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/channel.c b/src/channel.c
index 5f78777..46bdc0e 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -4890,9 +4890,15 @@
     void
 f_ch_log(typval_T *argvars, typval_T *rettv UNUSED)
 {
-    char_u	*msg = tv_get_string(&argvars[0]);
+    char_u	*msg;
     channel_T	*channel = NULL;
 
+    if (in_vim9script()
+	    && (check_for_string_arg(argvars, 0) == FAIL
+		|| check_for_opt_chan_or_job_arg(argvars, 1) == FAIL))
+	return;
+
+    msg = tv_get_string(&argvars[0]);
     if (argvars[1].v_type != VAR_UNKNOWN)
 	channel = get_channel_arg(&argvars[1], FALSE, FALSE, 0);