patch 8.2.2306: Vim9: when using function reference type is not checked
Problem: Vim9: when using function reference type is not checked.
Solution: When using a function reference lookup the type and check the
argument types. (issue #7629)
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 9810f41..c3aab20 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1790,9 +1790,9 @@
stack->ga_len + offset];
type_T *expected;
- if (varargs && i >= type->tt_min_argcount - 1)
+ if (varargs && i >= type->tt_argcount - 1)
expected = type->tt_args[
- type->tt_min_argcount - 1]->tt_member;
+ type->tt_argcount - 1]->tt_member;
else
expected = type->tt_args[i];
if (need_type(actual, expected, offset,