diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-08-27 19:08:40 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-08-27 19:08:40 +0200 |
commit | b49ad28d731551ddbd5cc57f9c77d0df085ae845 (patch) | |
tree | 646c8f3584f76f0a4799a884c8c2e4f0581ee706 /src/evalfunc.c | |
parent | 6a3897232aecd3e8b9e8b23955e55c1993e5baec (diff) |
patch 9.0.1801: Vim9 instanceof() fails in a def funcv9.0.1801
Problem: Vim9 instanceof() fails in a def func
Solution: allow Objects in compile time check
closes: #12907
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index bdfd6325fe..2cd1985a06 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -282,7 +282,11 @@ arg_number(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) static int arg_object(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) { - return check_arg_type(&t_object, type, context); + if (type->tt_type == VAR_OBJECT + || type_any_or_unknown(type)) + return OK; + arg_type_mismatch(&t_object, type, context->arg_idx + 1); + return FAIL; } /* |