diff src/evalfunc.c @ 25236:2c83f7b316d3 v8.2.3154

patch 8.2.3154: Vim9: some type checks for builtin functions fail Commit: https://github.com/vim/vim/commit/841e498c5d1765eab17bce5242543b47dfc25b41 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sun Jul 11 22:04:25 2021 +0200 patch 8.2.3154: Vim9: some type checks for builtin functions fail Problem: Vim9: some type checks for builtin functions fail. Solution: Correct the type checks. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8551, closes #8550)
author Bram Moolenaar <Bram@vim.org>
date Sun, 11 Jul 2021 22:15:04 +0200
parents a703b3f28ef4
children 11ed1f0adb01
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -431,9 +431,10 @@ arg_item_of_prev(type_T *type, argcontex
     static int
 arg_str_or_nr_or_list(type_T *type, argcontext_T *context)
 {
-    if (type->tt_type == VAR_STRING
-		     || type->tt_type == VAR_NUMBER
-		     || type->tt_type == VAR_LIST)
+    if (type->tt_type == VAR_ANY
+		|| type->tt_type == VAR_STRING
+		|| type->tt_type == VAR_NUMBER
+		|| type->tt_type == VAR_LIST)
 	return OK;
     arg_type_mismatch(&t_string, type, context->arg_idx + 1);
     return FAIL;