patch 8.2.1996: Vim9: invalid error for argument of extend()
Problem: Vim9: invalid error for argument of extend().
Solution: Check if the type could match. (closes #7299)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 8c090e3..d40f89f 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -295,7 +295,7 @@
static int
arg_number(type_T *type, argcontext_T *context)
{
- return check_type(&t_number, type, TRUE, context->arg_idx + 1);
+ return check_arg_type(&t_number, type, context->arg_idx + 1);
}
/*
@@ -304,7 +304,7 @@
static int
arg_string(type_T *type, argcontext_T *context)
{
- return check_type(&t_string, type, TRUE, context->arg_idx + 1);
+ return check_arg_type(&t_string, type, context->arg_idx + 1);
}
/*
@@ -342,7 +342,7 @@
{
type_T *prev_type = context->arg_types[context->arg_idx - 1];
- return check_type(prev_type, type, TRUE, context->arg_idx + 1);
+ return check_arg_type(prev_type, type, context->arg_idx + 1);
}
/*
@@ -363,7 +363,7 @@
// probably VAR_ANY, can't check
return OK;
- return check_type(expected, type, TRUE, context->arg_idx + 1);
+ return check_arg_type(expected, type, context->arg_idx + 1);
}
/*