Problem: Invalid memory access when checking function argument types.
Solution: Do not check beyond the number of arguments. (closes #11755)
Func()
END
v9.CheckScriptFailure(lines, 'E1013: Argument 2: type mismatch, expected number but got bool', 2)
+
+ lines =<< trim END
+ vim9script
+
+ def Foobar(Fn: func(any, ?string): any)
+ enddef
+
+ Foobar((t) => 0)
+ END
+ v9.CheckScriptSuccess(lines)
enddef
def Test_missing_return()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1104,
/**/
1103,
/**/
{
int i;
- for (i = 0; i < expected->tt_argcount; ++i)
+ for (i = 0; i < expected->tt_argcount && i < actual->tt_argcount; ++i)
// Allow for using "any" argument type, lambda's have them.
if (actual->tt_args[i] != &t_any && check_type(
expected->tt_args[i], actual->tt_args[i], FALSE,