summaryrefslogtreecommitdiffstats
path: root/src/vim9type.c
diff options
context:
space:
mode:
authorErnie Rael <errael@raelity.com>2023-10-17 18:15:01 +0200
committerChristian Brabandt <cb@256bit.org>2023-10-17 18:15:01 +0200
commit96952b2e98cb5f05bc3b3adfb0029056f39cffef (patch)
tree9b0209c19864027fa6a30d2d52fee030fd1e34da /src/vim9type.c
parentc290009e99405024a0d91ec7fab21ac7111c421b (diff)
patch 9.0.2043: Vim9: issue with funcref assignmentand varargsv9.0.2043
Problem: Vim9: issue with funcref assignmentand varargs Solution: Fix funcref type checking closes: #13351 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Ernie Rael <errael@raelity.com>
Diffstat (limited to 'src/vim9type.c')
-rw-r--r--src/vim9type.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vim9type.c b/src/vim9type.c
index 00ee76b487..6a5848792b 100644
--- a/src/vim9type.c
+++ b/src/vim9type.c
@@ -884,6 +884,11 @@ check_type_maybe(
else
ret = MAYBE;
}
+ if (ret != FAIL
+ && ((expected->tt_flags & TTFLAG_VARARGS)
+ != (actual->tt_flags & TTFLAG_VARARGS))
+ && expected->tt_argcount != -1)
+ ret = FAIL;
if (ret != FAIL && expected->tt_argcount != -1
&& actual->tt_min_argcount != -1
&& (actual->tt_argcount == -1