Mercurial > vim
diff src/vim9type.c @ 23640:8dcb2255ff9a v8.2.2362
patch 8.2.2362: Vim9: check of builtin function argument type is incomplete
Commit: https://github.com/vim/vim/commit/351ead09dd365ebdee2bfa27ab22542d4920c779
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 16 16:07:01 2021 +0100
patch 8.2.2362: Vim9: check of builtin function argument type is incomplete
Problem: Vim9: check of builtin function argument type is incomplete.
Solution: Use need_type() instead of check_arg_type().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 16 Jan 2021 16:15:04 +0100 |
parents | d3e064f54890 |
children | e3720756acdc |
line wrap: on
line diff
--- a/src/vim9type.c +++ b/src/vim9type.c @@ -514,25 +514,15 @@ check_type(type_T *expected, type_T *act } /* - * Like check_type() but also allow for a runtime type check. E.g. "any" can be - * used for "number". - */ - int -check_arg_type(type_T *expected, type_T *actual, int argidx) -{ - if (check_type(expected, actual, FALSE, 0) == OK - || use_typecheck(actual, expected)) - return OK; - // TODO: should generate a TYPECHECK instruction. - return check_type(expected, actual, TRUE, argidx); -} - -/* * Check that the arguments of "type" match "argvars[argcount]". * Return OK/FAIL. */ int -check_argument_types(type_T *type, typval_T *argvars, int argcount, char_u *name) +check_argument_types( + type_T *type, + typval_T *argvars, + int argcount, + char_u *name) { int varargs = (type->tt_flags & TTFLAG_VARARGS) ? 1 : 0; int i;