comparison 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
comparison
equal deleted inserted replaced
25235:fe1062c00045 25236:2c83f7b316d3
429 * Check "type" is a string or a number or a list 429 * Check "type" is a string or a number or a list
430 */ 430 */
431 static int 431 static int
432 arg_str_or_nr_or_list(type_T *type, argcontext_T *context) 432 arg_str_or_nr_or_list(type_T *type, argcontext_T *context)
433 { 433 {
434 if (type->tt_type == VAR_STRING 434 if (type->tt_type == VAR_ANY
435 || type->tt_type == VAR_NUMBER 435 || type->tt_type == VAR_STRING
436 || type->tt_type == VAR_LIST) 436 || type->tt_type == VAR_NUMBER
437 || type->tt_type == VAR_LIST)
437 return OK; 438 return OK;
438 arg_type_mismatch(&t_string, type, context->arg_idx + 1); 439 arg_type_mismatch(&t_string, type, context->arg_idx + 1);
439 return FAIL; 440 return FAIL;
440 } 441 }
441 442